Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Okay, so I have a model I need to build that involves a number of caveats.
For this specific area of the model, lets say I have 4 tables (granularity and range in parentheses):
I attached screenshots of the four tables to give an idea of the shape of the data (does this forum allow file upload?).
I have tried what seems like every combination of CALCULATE/FILTER/SUMX to get the values to calculate correctly, but it seems that I’m continuing to run into issues (incorrectly applied FX rates, incorrectly calculated subtotals, some combination of both, errors about multiple values supplied, etc.).
Ideally, for each month, I would like to calculate:
Is there an easy solution I am overlooking here, like using some sort of time intelligence function?
Thanks!
Hi @AvGeek,
Could you try the formulas(untested) below to see if it works in your scenario?
1.
The sum of its revenues in local currency = SUM ( RevNorm[AmountLocal] )
2.
The sum of its revenues converted to USD = SUMX ( RevNorm, RevNorm[AmountLocal] * LOOKUPVALUE ( FX[FX_Rate], FX[Currency], RevNorm[Currency], FX[Date], RevNorm[Date] ) )
3.
The sum of its base year equivalent revenues in local currency = VAR currentMonth = MAX ( Calendar[Month] ) RETURN IF ( currentMonth >= 10, CALCULATE ( SUM ( RevNorm[AmountLocal] ), FILTER ( ALL ( Calendar ), Calendar[Year] = 2007 && Calendar[Month] = currentMonth ) ), CALCULATE ( SUM ( RevNorm[AmountLocal] ), FILTER ( ALL ( Calendar ), Calendar[Year] = 2008 && Calendar[Month] = currentMonth ) ) )
4.
The sum of its base year equivalent revenues converted to USD = VAR currentYear = MAX ( Calendar[Year] ) VAR currentMonth = MAX ( Calendar[Month] ) VAR currentDate = MAX ( Calendar[Date] ) RETURN IF ( currentMonth >= 10, CALCULATE ( SUMX ( RevNorm, RevNorm[AmountLocal] * LOOKUPVALUE ( FX[FX_Rate], FX[Currency], RevNorm[Currency], FX[Date], currentDate ) ), FILTER ( ALL ( Calendar ), Calendar[Year] = 2007 && Calendar[Month] = currentMonth ) ), CALCULATE ( SUMX ( RevNorm, RevNorm[AmountLocal] * LOOKUPVALUE ( FX[FX_Rate], FX[Currency], RevNorm[Currency], FX[Date], currentDate ) ), FILTER ( ALL ( Calendar ), Calendar[Year] = 2008 && Calendar[Month] = currentMonth ) ) )
Regards
Hi @v-ljerr-msft,
Those formulas seemed to work with just a few exceptions:
Any idea how to fix #2?
Thanks!
Hi @AvGeek,
Could you try the formulas below to see if it works?
AmountLCL BY = SUMX ( Calendar, VAR currentMonth = MAX ( Calendar[Month] ) RETURN IF ( currentMonth >= 10, CALCULATE ( SUM ( RevNorm[AmountLocal] ), FILTER ( ALL ( Calendar ), Calendar[Year] = 2007 && Calendar[Month] = currentMonth ) ), CALCULATE ( SUM ( RevNorm[AmountLocal] ), FILTER ( ALL ( Calendar ), Calendar[Year] = 2008 && Calendar[Month] = currentMonth ) ) ) )
AmountUSD BY = SUMX ( Calendar, VAR currentYear = MAX ( Calendar[Year] ) VAR currentMonth = MAX ( Calendar[Month] ) VAR currentDate = MAX ( Calendar[Date] ) RETURN IF ( currentMonth >= 10, CALCULATE ( SUMX ( RevNorm, RevNorm[AmountLocal] / LOOKUPVALUE ( FX[FX_Rate], FX[Currency], RevNorm[Currency], FX[Date], currentDate ) ), FILTER ( ALL ( Calendar ), Calendar[Year] = 2007 && Calendar[Month] = currentMonth ) ), CALCULATE ( SUMX ( RevNorm, RevNorm[AmountLocal] / LOOKUPVALUE ( FX[FX_Rate], FX[Currency], RevNorm[Currency], FX[Date], currentDate ) ), FILTER ( ALL ( Calendar ), Calendar[Year] = 2008 && Calendar[Month] = currentMonth ) ) ) )
Regards
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
100 | |
100 | |
80 | |
77 | |
66 |
User | Count |
---|---|
134 | |
106 | |
104 | |
85 | |
73 |