Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi All
I have a table, unit* unit price, but the currency of unit price is different.
I want to creat a measure use SUMX to calculate the Product total price.
total price currency is SGD, 1 USD=1.32 SGD, 1 EUR=1.53 SGD
| Product | unit | Unit Price | currency |
| A | 100 | 5 | USD |
| B | 50 | 6 | SGD |
| C | 200 | 7 | USD |
| D | 500 | 8 | EUR |
I know how to add one if condition in sumx function, but I dont know how to add multiper if condition.
I've created a measure like this: Product price = SUMX( Table A, IF(Table A[Currency]="USD", Table A[Unit Price]*1.32*[unit])),
the results only show the USD product....
how to resovle?
Solved! Go to Solution.
Try this measure:
Product Price =
VAR vCurrency =
MAX ( TableA[currency] )
VAR vRate =
SWITCH ( vCurrency,
"SGD", 1,
"USD", 1.32,
"EUR", 1.53
)
VAR vResult =
SUMX ( TableA, TableA[unit] * TableA[Unit Price] * vRate )
RETURN
vResult
Consider creating an exchange rate table, instead of hardcoding rates in the measure.
Proud to be a Super User!
Try this measure:
Product Price =
VAR vCurrency =
MAX ( TableA[currency] )
VAR vRate =
SWITCH ( vCurrency,
"SGD", 1,
"USD", 1.32,
"EUR", 1.53
)
VAR vResult =
SUMX ( TableA, TableA[unit] * TableA[Unit Price] * vRate )
RETURN
vResult
Consider creating an exchange rate table, instead of hardcoding rates in the measure.
Proud to be a Super User!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.