Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have a fact table as below
Curreny Amount
usd 100
eur 75
cny 50
slicertable
Curreny rate_1 rate_2 rate_3
usd 1 1 1
eur 0.75 0.85 0.95
cny 0.50 0.65 0.80
rate_1_measure = 100*1 + 75*0.75 + 50*0.50
what I am trying is
Solved! Go to Solution.
Hi @Setosa
Please try below DAX in measure
Rate_1_Equivalent =
VAR CurrencyAmounts = SUMMARIZE('Facttable', facttable[Curreny], 'Facttable'[Amount])
VAR USD_Rate_1 = MAXX(FILTER('slicertable', slicertable[Curreny] = "usd"), 'slicertable'[rate_1])
VAR EUR_Rate_1 = MAXX(FILTER('slicertable', slicertable[Curreny] = "eur"), 'slicertable'[rate_1])
VAR CNY_Rate_1 = MAXX(FILTER('slicertable', slicertable[Curreny] = "cny"), 'slicertable'[rate_1])
RETURN
SUMX(
CurrencyAmounts,
SWITCH(
facttable[Curreny],
"usd", 'Facttable'[Amount] * USD_Rate_1,
"eur", 'Facttable'[Amount] * EUR_Rate_1,
"cny", 'Facttable'[Amount] * CNY_Rate_1
)
)
Let me know if that works for you
If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.
Thanks
Pijush
Linkedin
Proud to be a Super User! | |
Hi @Setosa
Please try below DAX in measure
Rate_1_Equivalent =
VAR CurrencyAmounts = SUMMARIZE('Facttable', facttable[Curreny], 'Facttable'[Amount])
VAR USD_Rate_1 = MAXX(FILTER('slicertable', slicertable[Curreny] = "usd"), 'slicertable'[rate_1])
VAR EUR_Rate_1 = MAXX(FILTER('slicertable', slicertable[Curreny] = "eur"), 'slicertable'[rate_1])
VAR CNY_Rate_1 = MAXX(FILTER('slicertable', slicertable[Curreny] = "cny"), 'slicertable'[rate_1])
RETURN
SUMX(
CurrencyAmounts,
SWITCH(
facttable[Curreny],
"usd", 'Facttable'[Amount] * USD_Rate_1,
"eur", 'Facttable'[Amount] * EUR_Rate_1,
"cny", 'Facttable'[Amount] * CNY_Rate_1
)
)
Let me know if that works for you
If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.
Thanks
Pijush
Linkedin
Proud to be a Super User! | |
thank you very much.
Hi @Setosa
If it is working, please mark my PREVIOUS comment as SOLUTION
Proud to be a Super User! | |
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
116 | |
101 | |
88 | |
35 | |
35 |
User | Count |
---|---|
152 | |
100 | |
83 | |
63 | |
54 |