The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
26 | |
10 | |
8 | |
6 | |
6 |
User | Count |
---|---|
31 | |
12 | |
10 | |
10 | |
9 |