We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi,
How can I create a custom column to take at value from my other table in power query:
I am using the below but does not work:
Exchange_Rates[Exchange Rate],FILTER(Exchange_Rates, Combined_for_GL_Check[Entered Currency]= Exchange_Rates[Currency]
Solved! Go to Solution.
Hi @craig811 ,
We can create a custom column and expand it to meet your requirement:
let c = [Entered Currency]
in Table.SelectRows(Exchange_Rates,each [Currency] =
c)
All the queries are here:
Exchange_Rates:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUbJUitWJVnICsgwNwExnENMQzHQBMs3BLFcgy1gpNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Currency = _t, #"Exchange Rate" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Currency", type text}, {"Exchange Rate", Int64.Type}})
in
#"Changed Type"
Combined_for_GL_Check:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YlWcgKTzmDSBUy6KsXGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Entered Currency" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Entered Currency", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Rate", each let c = [Entered Currency]
in Table.SelectRows(Exchange_Rates,each [Currency] =
c)),
#"Expanded Rate" = Table.ExpandTableColumn(#"Added Custom", "Rate", {"Exchange Rate"}, {"Rate.Exchange Rate"})
in
#"Expanded Rate"
Or we can create a calculated column to meet your requirement:
Rate_Dax = LOOKUPVALUE('Exchange_Rates'[Exchange Rate],'Exchange_Rates'[Currency],[Entered Currency])
Best regards,
Hi @craig811 ,
We can create a custom column and expand it to meet your requirement:
let c = [Entered Currency]
in Table.SelectRows(Exchange_Rates,each [Currency] =
c)
All the queries are here:
Exchange_Rates:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclTSUbJUitWJVnICsgwNwExnENMQzHQBMs3BLFcgy1gpNhYA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Currency = _t, #"Exchange Rate" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Currency", type text}, {"Exchange Rate", Int64.Type}})
in
#"Changed Type"
Combined_for_GL_Check:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YlWcgKTzmDSBUy6KsXGAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [#"Entered Currency" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Entered Currency", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Rate", each let c = [Entered Currency]
in Table.SelectRows(Exchange_Rates,each [Currency] =
c)),
#"Expanded Rate" = Table.ExpandTableColumn(#"Added Custom", "Rate", {"Exchange Rate"}, {"Rate.Exchange Rate"})
in
#"Expanded Rate"
Or we can create a calculated column to meet your requirement:
Rate_Dax = LOOKUPVALUE('Exchange_Rates'[Exchange Rate],'Exchange_Rates'[Currency],[Entered Currency])
Best regards,
Great thank you
If you absolutely have to have it in Power Query, @ImkeF might have a solution.
hi @craig811
you are trying to do it in Power Query Editor, but as you have so simple statement it should be enough to create relationships between Combined_for_GL_Check[Entered Currency] and Exchange_Rates[Currency] fields (if it has 1-to-1 or manyt-to-one connections).
you will bw able to add this value in other places of your report without additionalcoding
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 10 | |
| 8 | |
| 7 | |
| 7 | |
| 5 |