Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
nikhil0511
Advocate I
Advocate I

Adding Parameters from a table or merging two unrelated tables

Hello,

 

I have two questions to ask in regards to dataflow tables.

 

First, I have a table with n columns and has a single row, each column is normally used as a parameter for my calculations. 

 

I normally use sumx and filter in excel or power pivot or power query to get these values into another table and use it for my calculations. I tried doing the same in power bi dataflow tables , but unable to do so. 

 

Second, if the above process cannot be done, can I get these column values as parameters and use them in my calculations in my other table.

 

Parameter table

idDateparameter1Parameter2parameter3parameter4parameter5parameter6
101/31/20220.81.22003.330.87

 

Other table

Key columnweightlengthwidthheightcorrected weightcorrected  length
1003453000.89177023weight+parameter1corrected weight*parameter2 

 

Please help me out on this.

 

Thanks in advance.

1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @nikhil0511 ,

 

This the same as power query.

Get data from another table use #"table_name"[column_name]{int_index_of_row}.

vchenwuzmsft_0-1643872197275.png

Code:

 

 

 

let
  Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwMDYxNTYwUNJRMtCzsARShubmIA4QGxkrxcYCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Key column" = _t, weight = _t, length = _t, width = _t, height = _t]),
  #"Changed column type" = Table.TransformColumnTypes(Source, {{"Key column", Int64.Type}, {"weight", type number}, {"length", Int64.Type}, {"width", Int64.Type}, {"height", Int64.Type}}),
  #"Added custom" = Table.AddColumn(#"Changed column type", "corrected weight", each [weight]+#"Parameter table"[parameter1]{0}),
  #"Added custom 1" = Table.AddColumn(#"Added custom", "corrected  length", each [corrected weight]+#"Parameter table"[Parameter2]{0})
in
  #"Added custom 1"

 

 

 

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-chenwuz-msft
Community Support
Community Support

Hi @nikhil0511 ,

 

This the same as power query.

Get data from another table use #"table_name"[column_name]{int_index_of_row}.

vchenwuzmsft_0-1643872197275.png

Code:

 

 

 

let
  Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQwMDYxNTYwUNJRMtCzsARShubmIA4QGxkrxcYCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Key column" = _t, weight = _t, length = _t, width = _t, height = _t]),
  #"Changed column type" = Table.TransformColumnTypes(Source, {{"Key column", Int64.Type}, {"weight", type number}, {"length", Int64.Type}, {"width", Int64.Type}, {"height", Int64.Type}}),
  #"Added custom" = Table.AddColumn(#"Changed column type", "corrected weight", each [weight]+#"Parameter table"[parameter1]{0}),
  #"Added custom 1" = Table.AddColumn(#"Added custom", "corrected  length", each [corrected weight]+#"Parameter table"[Parameter2]{0})
in
  #"Added custom 1"

 

 

 

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

nikhil0511
Advocate I
Advocate I

I have made a temporary fix to this issue, by adding a common column to the both tables.

 

Say a column named Status - "Active" or "Inactive" in Parameters table and added a column Status - "Active"  in other table and merged these tables with this column. 

 

But needed a solution where these parameter table columns value can be used as a parameter or created as a parameter, so that I can use them globaly in my dataflow tables.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors