Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Conditional Cumulative Sum of the Actual and Forecast Data

Hello Guys,

 

I am looking for cumulative sum of the where I need to add Forecast values when Actuals ate not there and take cumulative of that measure.

 

Here is the sample data:

YearMonthGeneration Actual MTDGeneration Forecast MTD_GraphGeneration Actual MTD_GrpahCumulative_Actual YTD
2022January4,47,9869,89,6384,47,9864,47,986
2022February09,96,1529,96,15214,44,138
2022March011,66,35011,66,35026,10,488
2022April012,24,85512,24,85538,35,343
2022May013,90,22913,90,22952,25,571
2022June014,28,48114,28,48166,54,053
2022July014,82,14014,82,14081,36,193
2022August014,25,57514,25,57595,61,768
2022September012,63,02412,63,0241,08,24,791
2022October012,13,45712,13,4571,20,38,248
2022November010,53,83810,53,8381,30,92,087
2022December09,85,4199,85,4191,40,77,506

 

Measures used in above table:

Generation Actual MTD_Grpah =

IF([Generation Actual MTD]<>0[Generation Actual MTD],
[Generation Forecast MTD_Graph])
 
Expected result is in the "Cumulative_Actual YTD" column - this is where I need help to create measure. Please note that I need measure only not a calculated column. I need to take cumulative of the column where we have taken Forrecast whenever Actuals are not available.
 
Thanks,
Ram
1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Please try the following measure:

 

Cumulative_Actual YTD = 
SUMX (
    FILTER ( ALLSELECTED ( Dates ), Dates[Date] <= MAX ( Dates[Date] ) ),
    [Generation Actual MTD_Grpah]
)

vkkfmsft_0-1645148362209.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hello Guys,

 

I am looking for cumulative sum of the where I need to add Forecast values when Actuals ate not there and take cumulative of that measure.

 

Here is the sample data:

YearMonthGeneration Actual MTDGeneration Forecast MTD_GraphGeneration Actual MTD_GrpahCumulative_Actual YTD
2022January4,47,9869,89,6384,47,9864,47,986
2022February09,96,1529,96,15214,44,138
2022March011,66,35011,66,35026,10,488
2022April012,24,85512,24,85538,35,343
2022May013,90,22913,90,22952,25,571
2022June014,28,48114,28,48166,54,053
2022July014,82,14014,82,14081,36,193
2022August014,25,57514,25,57595,61,768
2022September012,63,02412,63,0241,08,24,791
2022October012,13,45712,13,4571,20,38,248
2022November010,53,83810,53,8381,30,92,087
2022December09,85,4199,85,4191,40,77,506

 

Measures used in above table:

Generation Actual MTD_Grpah =

IF([Generation Actual MTD]<>0, [Generation Actual MTD],
[Generation Forecast MTD_Graph])
 
Expected result is in the "Cumulative_Actual YTD" column - this is where I need help to create measure. Please note that I need measure only not a calculated column. I need to take cumulative of the column where we have taken Forrecast whenever Actuals are not available.
 
Thanks,
Ram
 

Hi @Anonymous ,

 

I'm not quite sure if I understand your needs accurately. Would you mind telling me a more detailed description of your needs so that I can help you better?

 

Hope it helps,

 

Community Support Team _ Caitlyn

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Guys, please help!!

 

 

Anonymous
Not applicable

Can you please help me with a working .pbix file.

 

Hi @Anonymous ,

 

Please try the following measure:

 

Cumulative_Actual YTD = 
SUMX (
    FILTER ( ALLSELECTED ( Dates ), Dates[Date] <= MAX ( Dates[Date] ) ),
    [Generation Actual MTD_Grpah]
)

vkkfmsft_0-1645148362209.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , assume you have measures like

 

M1= Sum(Table1[Actual])

M2= Sum(Table2[Forecast])

 

then create measure like
calculate( sumx(values('Date'[Month Year]), if( isblank([M1]), [M2], [M1])), datesytd('Date'[date]))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.