Re-apply formulas to a new source of same type in power bi

Viewed 96

I am working on building reports in Power BI. I have created various reports using formulas etc. Now I am going to add another source of data that has the same number of columns as my previous source.

Source Data enter image description here

Source 2

enter image description here

I have added some formulizations and new columns that I want exactly to replicate onto the new source which has the same column names, type but different data.

Is there any way that I can do this? Any help would be highly appreciated

1 Answers

If I understand your question correctly, you want two connections in one query. For this purpose you define a parameter.(For example "Connection") If its value was 1, the query loaded from source 1 and if its value was 2 was loaded from source 2.

let  
    MySource = if Connection=1 then
        let
            Source = source_1,
            #"Changed Type" = ...,
        in
            #"Changed Type"
    else
        let
            Source = source_2,
            #"Changed Type" = ...,        
        in
            #"Changed Type",
    #"Removed Columns" = Table.RemoveColumns(MySource, {"Column3"})
    #"Removed Columns1" = ...
in
    #"Removed Columns1"```
Related