Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello Community,
How can I find the cumulative sum of Plan and Actual column for the coloured period (month_year) using DAX.
The below screenshot is from Excel.
Solved! Go to Solution.
Hi @devpp,
If you want ot the cumulative causation cut off at the year end, I'd like to suggest add a condition to check the current year.
I modify the above formulas to add the filter condition on year to the two expressions:
Cumm Planned =
CALCULATE (
SUM ( Table[Plan] ),
FILTER (
ALL ( Table ),
Table[month_year] <= EARLIER ( Table[month_year] )
&& YEAR ( Table[month_year] ) = YEAR ( EARLIER ( Table[month_year] ) )
)
)
Cumm Actual =
CALCULATE (
SUM ( Table[Actual] ),
FILTER (
ALL ( Table ),
Table[month_year] <= EARLIER ( Table[month_year] )
&& YEAR ( Table[month_year] ) = YEAR ( EARLIER ( Table[month_year] ) )
)
)
Regards,
Xiaoxin Sheng
Hi @devpp ,
Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.
If these also don't help, please share more detailed information and description to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Cumulative Planned:
DAX
Cumm Planned =
CALCULATE(
SUM(Table[Plan]),
FILTER(
ALL(Table),
Table[month_year] <= EARLIER(Table[month_year])
)
)
Cumulative Actual:
DAX
Cumm Actual =
CALCULATE(
SUM(Table[Actual]),
FILTER(
ALL(Table),
Table[month_year] <= EARLIER(Table[month_year])
)
)
Table is the name of your table.
Proud to be a Super User! |
|
Hi bhanu_gautam,
The answer is close...here I need to find the cumulative for that year only...In this case it should stop at 172 when 2024 completes and then start fresh for 2025.
For 2025 in the control year it should start from 7 and end at 13
Hi @devpp,
If you want ot the cumulative causation cut off at the year end, I'd like to suggest add a condition to check the current year.
I modify the above formulas to add the filter condition on year to the two expressions:
Cumm Planned =
CALCULATE (
SUM ( Table[Plan] ),
FILTER (
ALL ( Table ),
Table[month_year] <= EARLIER ( Table[month_year] )
&& YEAR ( Table[month_year] ) = YEAR ( EARLIER ( Table[month_year] ) )
)
)
Cumm Actual =
CALCULATE (
SUM ( Table[Actual] ),
FILTER (
ALL ( Table ),
Table[month_year] <= EARLIER ( Table[month_year] )
&& YEAR ( Table[month_year] ) = YEAR ( EARLIER ( Table[month_year] ) )
)
)
Regards,
Xiaoxin Sheng
User | Count |
---|---|
25 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
26 | |
12 | |
11 | |
8 | |
6 |