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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

Help on cumulative calculation

My data set is 

datsetMonthvalue
ACTFeb2
LMNfeb3
UFGJan2
ACTJan3
ACTMar0
LMNMar1
ACTApril0

 

I need column chart with 

X axis Month

Y axis value

and chart to be shown cummulative value for ACT datasets only. The value( bar) to be shown for month Jan, Feb only but no value should be shown for Mar and April

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

We can nest an IF function outside the original formula to meet your requirement.

 

Measure = 
IF (
    MAX ( 'Table'[value] ) = 0,
    0,
    VAR x =
        MIN ( 'Table'[month number] )
    RETURN
        CALCULATE (
            SUM ( 'Table'[value] ),
            FILTER ( ALLSELECTED ( 'Table' ), 'Table'[month number] <= x )
        )
)

 

The result like this,

 

follow-help.jpg

 

For the sample, we add a new row, what is your expected result for May, 6 or 1?

 

follow-help4.jpg

 

follow-help3.jpg

 

BTW, pbix as attached.

 

Best regards,


Community Support Team _ zhenbw
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

10 REPLIES 10
v-zhenbw-msft
Community Support
Community Support

Hi @amitchandak ,

 

We can use the following steps to meet your requirement.

1. Create a month number column, add the corresponding number to the month,

 

 

month number = MONTH('Table'[date])

 

 

1.PNG

 

 

 

 

 

 

 

2. Then create a measure,

 

 

Measure =
var x = MIN('Table'[month number])
return
CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'),'Table'[month number]<=x))

 

 

And add two slicer to control the measure, we can get the result like this,

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

BTW, pbix as attached. 

 

Best regards,


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

Anonymous
Not applicable

hi

 

unable to access the PBIX.

Hi @Anonymous ,

 

Sorry for that, here is another link, you can try again.

 

Best regards,


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

Anonymous
Not applicable

hi.. i saw the pbix. My requiremnt is 

 

If I select all the months( ACT dataset),  the value in the bar should come 0 for Mar and April. Though the value for Jan and Feb is correct ( as per cummulative)  .

Hi @Anonymous ,

 

We can nest an IF function outside the original formula to meet your requirement.

 

Measure = 
IF (
    MAX ( 'Table'[value] ) = 0,
    0,
    VAR x =
        MIN ( 'Table'[month number] )
    RETURN
        CALCULATE (
            SUM ( 'Table'[value] ),
            FILTER ( ALLSELECTED ( 'Table' ), 'Table'[month number] <= x )
        )
)

 

The result like this,

 

follow-help.jpg

 

For the sample, we add a new row, what is your expected result for May, 6 or 1?

 

follow-help4.jpg

 

follow-help3.jpg

 

BTW, pbix as attached.

 

Best regards,


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

Anonymous
Not applicable

perfect

@v-zhenbw-msft , is it for me ?

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak ,

 

Sorry @wrong people.

 

Best Regards,


Community Support Team _ zhenbw
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

In case you have date, You can create cumulative like this

Cumm Sales = CALCULATE(SUM(Table[Value]),filter(date,date[date] <=maxx(date,date[date])))
Cumm Sales = CALCULATE(SUM(Table[Value]),filter(date,date[date] <=max(Table[Date])))

 

What is format you have month in you raw data

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Not working. This is not giving the desired result.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors