Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello!
I would need help to know how I can achieve the annual cumulative formula.
And what I need is to make a cumulative where I leave a fixed base month, for the cumulative of 2023 it has to take December 2022 as a base
With the DATESYTD measure, it allows me but compares me month to month, it took me October 2022-October 2023
Does anyone know how I could do it?
Thank you
Solved! Go to Solution.
Hi @Maurosaa93 ,
Have you solved your problem?
If you must need use measure, you can modify DAX as follows:
_Value1 =
VAR CurrentYear = YEAR(MAX('Table'[Y-M]))
VAR CurrentMonth = MONTH(MAX('Table'[Y-M]))
RETURN
CALCULATE(
SUM('Table'[Value]),
FILTER(
ALL('Table'),
(YEAR('Table'[Y-M]) = CurrentYear && MONTH('Table'[Y-M]) <= CurrentMonth) || (YEAR('Table'[Y-M]) = CurrentYear - 1 && MONTH('Table'[Y-M]) = 12)
)
)
The output is the same:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Maurosaa93 ,
If I understand you correctly, you want to do monthly accruals and restart accruals across years using December of the previous year as the starting data. Please try this way.
Here is my sample data:
Use this DAX to create a calculated column:
_Value =
VAR CurrentYear = YEAR('Table'[Y-M])
VAR CurrentMonth = MONTH('Table'[Y-M])
RETURN
CALCULATE(
SUM('Table'[Value]),
FILTER(
ALL('Table'),
(YEAR('Table'[Y-M]) = CurrentYear && MONTH('Table'[Y-M]) <= CurrentMonth) || (YEAR('Table'[Y-M]) = CurrentYear - 1 && MONTH('Table'[Y-M]) = 12)
)
)
And the final output is as below:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Maurosaa93 ,
Have you solved your problem?
If you must need use measure, you can modify DAX as follows:
_Value1 =
VAR CurrentYear = YEAR(MAX('Table'[Y-M]))
VAR CurrentMonth = MONTH(MAX('Table'[Y-M]))
RETURN
CALCULATE(
SUM('Table'[Value]),
FILTER(
ALL('Table'),
(YEAR('Table'[Y-M]) = CurrentYear && MONTH('Table'[Y-M]) <= CurrentMonth) || (YEAR('Table'[Y-M]) = CurrentYear - 1 && MONTH('Table'[Y-M]) = 12)
)
)
The output is the same:
Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Can you please share your data or your model ?
User | Count |
---|---|
84 | |
78 | |
70 | |
47 | |
42 |
User | Count |
---|---|
106 | |
50 | |
49 | |
40 | |
40 |