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.
Hello I'm new to DAX Syntaxe and I want to create a mesure that calculate the cumulative value of the budget for the years 2021 and 2022 . exemple: budget for date 01/01/2021 :200 and budget for 01/01/2022 : 200 , the result should be cumulative for 01/01/2021: 200 and for 01/01/2022: 400 . By this formula the result is good for the year 2021 but the cumulative value for 2022 is giving a value more than the expected again as I sad the SUM need to be only between the same dates 01/01/2021 goes with 01/01/2022.
The current code That I have used is:
Accumulated =
VAR vCurrentYear = YEAR( MAX( Abfrage1[date] ) )
RETURN
IF(
vCurrentYear = 2022,
CALCULATE(
SUM( Abfrage1[budget] ),
DATESINPERIOD(
'Abfrage1'[Date],
MAX( 'Abfrage1'[Date] ),
-1,
YEAR
)
),
SUM( Abfrage1[budget] )
)
Sorry if i am mis-understanding. But If you have budgets set for each month of 2021 then your measure for 2022 will be the sum of all the budgets in the range. Not just 200+200. But 200+200+200+200+....
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 |
---|---|
43 | |
20 | |
18 | |
16 | |
15 |
User | Count |
---|---|
49 | |
26 | |
22 | |
17 | |
16 |