Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have 2 querys in Power Query, lets call them Query1 and Query2.
I need to use an index from a table in Query2 to remove a dynamic number of top rows in Query1.
I know how to reference a table within the same query, but I'm not sure the syntax to reference the seperate query.
The funtion would be = Table.Skip(#"Query1, ??????)
How can I phrase that second parameter to look to the index column on the table within Query2?
Solved! Go to Solution.
HI @Anonymous,
You can reference in several ways depends also on the information you need. In the example below I created 2 tables and make reference of the first in the second table. (very simply and iniffective example from the data point of view).
Table1 let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlaKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]) in Source Table2 let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlSK1YlWMgKTxmDSBEyagkkzMGkOJi3ApCWYNDRQio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", Int64.Type}}), Custom1 = Table.Skip(#"Changed Type",Number.FromText(List.Max(Table.ToList(Table1)))) in Custom1
See code above for 2 simple tables where In step Custom1 I reference to the Table1 data to get information for the calculation.
If you also add a blank step on your query you can reference the other query by name simply:
= QueryThatYouWantToReference
Then you have the query within the steps and can reference back to it, as you refer.
Hope this helps.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHI @Anonymous,
You can reference in several ways depends also on the information you need. In the example below I created 2 tables and make reference of the first in the second table. (very simply and iniffective example from the data point of view).
Table1 let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlaKjQUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]) in Source Table2 let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlSK1YlWMgKTxmDSBEyagkkzMGkOJi3ApCWYNDRQio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", Int64.Type}}), Custom1 = Table.Skip(#"Changed Type",Number.FromText(List.Max(Table.ToList(Table1)))) in Custom1
See code above for 2 simple tables where In step Custom1 I reference to the Table1 data to get information for the calculation.
If you also add a blank step on your query you can reference the other query by name simply:
= QueryThatYouWantToReference
Then you have the query within the steps and can reference back to it, as you refer.
Hope this helps.
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsI would call @ImkeF in for a rescue here but Notifications are not working. I would send her a private message.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
101 | |
86 | |
64 |