Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I have a dax code as follows and I need to add a filter argument but somehow the result is coming unexpected.
VAR CurrencyAmounts =
SUMMARIZE(
FILTER(facttable, facttable[COL] = "abc"),
facttable[Currency], 'facttable'[Amount])
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
)
)
Solved! Go to Solution.
Hi @Setosa ,
Please try the following methods and check if they can solve your problem:
1.Create the simple table.
2.Create the new measure to filter.
Rate_1_Equivalent =
VAR CurrencyAmounts =
SUMMARIZE(
FILTER(facttable, facttable[COL] = "abc"),
facttable[Currency],
"TotalAmount", SUM(facttable[Amount])
)
VAR USD_Rate_1 = MAXX(FILTER(slicerTable, slicerTable[Currency] = "usd"), slicerTable[rate_1])
VAR EUR_Rate_1 = MAXX(FILTER(slicerTable, slicerTable[Currency] = "eur"), slicerTable[rate_1])
VAR CNY_Rate_1 = MAXX(FILTER(slicerTable, slicerTable[Currency] = "cny"), slicerTable[rate_1])
RETURN
SUMX(
CurrencyAmounts,
SWITCH(
[Currency],
"usd", [TotalAmount] * USD_Rate_1,
"eur", [TotalAmount] * EUR_Rate_1,
"cny", [TotalAmount] * CNY_Rate_1
)
)
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Setosa ,
Please try the following methods and check if they can solve your problem:
1.Create the simple table.
2.Create the new measure to filter.
Rate_1_Equivalent =
VAR CurrencyAmounts =
SUMMARIZE(
FILTER(facttable, facttable[COL] = "abc"),
facttable[Currency],
"TotalAmount", SUM(facttable[Amount])
)
VAR USD_Rate_1 = MAXX(FILTER(slicerTable, slicerTable[Currency] = "usd"), slicerTable[rate_1])
VAR EUR_Rate_1 = MAXX(FILTER(slicerTable, slicerTable[Currency] = "eur"), slicerTable[rate_1])
VAR CNY_Rate_1 = MAXX(FILTER(slicerTable, slicerTable[Currency] = "cny"), slicerTable[rate_1])
RETURN
SUMX(
CurrencyAmounts,
SWITCH(
[Currency],
"usd", [TotalAmount] * USD_Rate_1,
"eur", [TotalAmount] * EUR_Rate_1,
"cny", [TotalAmount] * CNY_Rate_1
)
)
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
8 |
User | Count |
---|---|
22 | |
13 | |
11 | |
10 | |
10 |