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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
oc
New Member

Calculating cumulative values

I am trying to calculate cumulative values. I tried: Cumulative_Forecast = CALCULATE(sum(TEAMS_Forecast_LineItems[ForeCast_Value]), filter(ALLEXCEPT(TEAMS_Forecast_LineItems,TEAMS_Forecast_LineItems[ForeCast_Year]), TEAMS_Forecast_LineItems[MonthNumber]<=EARLIER(TEAMS_Forecast_LineItems[MonthNumber]) ) ) Cumulative_Forecast2 = VAR RowDate = TEAMS_Forecast_LineItems[Forecast_Date] return CALCULATE(sum(TEAMS_Forecast_LineItems[ForeCast_Value]), FILTER(TEAMS_Forecast_LineItems, TEAMS_Forecast_LineItems[Forecast_Date]<=RowDate && YEAR ( TEAMS_Forecast_LineItems[Forecast_Date] ) = YEAR ( RowDate ))) Cumulative_Forecast3 = TOTALYTD(sum(TEAMS_Forecast_LineItems[ForeCast_Value]), 'Calendar'[Date]) Cumulative_Forecast4 = CALCULATE(sum(TEAMS_Forecast_LineItems[ForeCast_Value]), filter(ALL(DimDate[Date]), DimDate[Date] <= Max(DimDate[Date])) ) None of them worked. Here is the columns of my table: ForeCast_Value / Forecast_Date / Month / MonthNumber / ForeCast_BU / ForeCast_Year / ForeCast_ID And some examples of records: 71100 / Saturday, September 1, 2018 / Sep / 9 / 105 / 2018 / 10648 71100 / Monday, October 1, 2018 / Oct / 10 / 2018 / 10648 81000 / Saturday, September 1, 2018 / Sep / 9 / 105 / 2018 / 10649 71200 / Saturday, September 1, 2018 / Sep / 9 / 120 / 2018 / 10700 My first report has Month on the axis, ForeCast_BU on the legend and ForeCast_Value on Values. I want my second report as Month on the axis, ForeCast_BU on the legend and cumulative ForeCast_Value on Values.
4 REPLIES 4
oc
New Member

I couldn`t find how to report this bug but i am unable to post rich text messages to forum. This screenshot may help. https://ibb.co/R6rZwq1
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @oc,

 

Sorry for the delay.

 

If it is convenient, could you share your data sample as table format in here and your desired output so that we could help further on it?

 

Hope you could paste your data here this time.

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @oc,

 

By my test, it seems that your formulas are calculated columns. I'm afraid that you'd better create measure to calculate the cumulative values.

 

Please try to create the measure with the formula below.

 

Measure =
CALCULATE (
    SUM ( TEAMS_Forecast_LineItems[ForeCast_Value] ),
    FILTER (
        ALLEXCEPT ( TEAMS_Forecast_LineItems, TEAMS_Forecast_LineItems[ForeCast_Year] ),
        TEAMS_Forecast_LineItems[MonthNumber]
            <= MAX ( 'TEAMS_Forecast_LineItems'[MonthNumber] )
    )
)

If you still need help, please share your data sample with table format so that I can copy and test with it, and your desired output about cumulative values so that I can get the solution quickly.

 

Best  Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

It didn`t work. Here are some part of my data. Sorry I cant add picture to the message because there are some js errors on page. I have a line chart; Month on the Axis, BU on the legend and value on values. When slicer year=all is selected Business 1= 152100 and Business 2 =232800 on September Business 1= 71100 and Business 2 =80600 on October When slicer year=2017 selected Business 2=80600 on Sep Business 2=80500 on Oct I want to create a new line chart for cumulative values. Desired values are: When slicer year=all is selected Business 1= 152100 and Business 2 =232800 on September Business 1= 223200 and Business 2 =313400 on October When slicer year=2017 selected Business 2=80600 on Sep Business 2=161100 on Oct According to this data: ForeCast_Value Month MonthNumber ForeCast_BU ForeCast_Year ForeCast_ID 71100 Sep 9 Business1 2018 10648 71100 Oct 10 Business1 2018 10648 81000 Sep 9 Business1 2018 10649 71200 Sep 9 Business2 2018 10700 80500 Sep 9 Business2 2017 10500 80600 Oct 10 Business2 2017 10500 81100 Sep 9 Business2 2018 10650

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.