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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
janainacarmo
Regular Visitor

Cumulate quantity

Hello Guys!

 

Please, see if you guys can help me with this question.
I have to calculate the accumulate year to year of quantity, as example below:

 

A car has to have his oil changed every year, so, if I have 10 cars having  their oil changed in 2017 and 20 cars having their oil changed in 2018, the index has to calculate:

2017: 10

2018: 20 + 10 (from 2017, because the same 10 cars in 2017, has to have the oil changed again in 2018)

Total: 40 cars   

 

I created the following index that is working partially, it means that is calculating right, but if I change the period to see the data just in 2018, the index continue calculating from 2017, so it's is showing 40 quantity rather than 20 .

 

measure = CALCULATE (
SUMX(TIV;[Valor]);
FILTER(
ALLEXCEPT(TIV;TIV[Linha];TIV[Segmento]);
'TIV'[year] <= MAX ( 'TIV'[year])); ALLEXCEPT(TIV;TIV[Linha];TIV[Segmento]);TIV[Brand]="Other"
)
 
Waiting for your support guys, thank you!
Janaina
4 REPLIES 4
v-yuta-msft
Community Support
Community Support

@janainacarmo ,

 

You may modify your measure using dax below:

measure =
CALCULATE (
    SUMX ( TIV; [Valor] );
    FILTER (
        ALLEXCEPT ( TIV; TIV[Linha]; TIV[Segmento] );
        TIV[Brand] = "Other"
            && 'TIV'[year] IN VALUES ( 'TIV'[year] )
    )
)

Community Support Team _ Jimmy Tao

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

Dear @v-yuta-msft ,

 

Thank you for your reply, but this index is not working as cummulative...it is just counting the value year per year.

 

Thank you for your supporting until now.

 

Best Regards, Janaina

Nathaniel_C
Community Champion
Community Champion

Hi @janainacarmo ,

 

This cumulative count works in dashboard and works with a time slicer and a program slicer.
Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel

 

Cumulative Count of Customers = 

VAR MaxDate = MAX ( aver[Date] )-- Saves the last visible date
var Counter =
    CALCULATE (
        [Count of customers],            -- Computes customers
        aver[Date]<= MaxDate,   -- Where date is before the last visible date
        ALLEXCEPT( aver,aver[Program] )              -- Removes any other filters from Date allexcept aver([Program]

   )
return Counter




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Dear @Nathaniel_C ,

 

Thank you for your reply, but it still not working properly...the cumulative is working fine, but when I change the períod for 2017-2019, it still being summing the value from 2016. The total from the first year, in the period that I chose in the time slicer, should not be cumulative. I attached two prints (períod 2016-2019 and 2017-2019) and highlighted them in yellow as you can see.

 

https://drive.google.com/drive/folders/1TBOsDKqiGUfnsGZugNfcZfF4-OiDCtYm?usp=sharing

 

Thank you for your support until now.

Best Regards, Janaina

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.