Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
I have the below dataset and user country as a filter. The task is to calculate the revenue - calculated as sum paid in this month - sum paid in the previous month. It should be calculated in USD. The solution of multiplying the exchange rate in the below table, then, creating a measure using PREVIOUSMONTH and then, doing subtraction doesn't work because of the high exchange rate fluctuation.
The solution we came with was to calculate the revenue in the local currency. And then, if a user selects Switzerland from the filter, the revenue will be multiplied by the exchange rate for the corresponding country and corresponding date.
Here are the formulas in practice:
And it is working just fine when you select a particular country, however, I cannot a formula work when no country is selected. I've uploaded the sample at
https://drive.google.com/file/d/1ADLoDNSVBFo-G_SYj30xPH490yTDNXrL/view?usp=sharing.
My attempt to do the filter is in the measure final
Solved! Go to Solution.
Hi @ekaponkratova ,
To update your measure as below.
final_calc = IF ( ISFILTERED ( Sheet1[country] ) = FALSE (), CALCULATE ( SUM ( Sheet1[cum sum paid] ), DATEADD ( 'calendar_3'[Date], -1, MONTH ), Sheet1[country] = "Spain" ) )
Hi @ekaponkratova ,
To update your measure as below.
final_calc = IF ( ISFILTERED ( Sheet1[country] ) = FALSE (), CALCULATE ( SUM ( Sheet1[cum sum paid] ), DATEADD ( 'calendar_3'[Date], -1, MONTH ), Sheet1[country] = "Spain" ) )
@ekaponkratova - You'll want to do something like SUMX(YourTable[Raw Revenue]*ExchangeRates[Rate])
Because you need to calculate the value for each day and then sum them up.
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
102 | |
68 | |
46 | |
37 | |
37 |