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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Hombleu
Regular Visitor

Cumulative count of rows

Hi guys,

 

Maybe someone could help me with this issue..

I've made a connection with MYSQL db in Power BI. The db rows are based on daily base. So I've already created a countrows measure to count the rows per day. But now I'm looking for a cumulative measure of the rows per day.

 

So the rows per day can be counted in a cumulative way.

3 REPLIES 3
v-haibl-msft
Microsoft Employee
Microsoft Employee

@Hombleu

 

Please follow the solution provided by jPinhao, you should only need to do small change to formula if you want to get the cumulative rows – replace [number] with your countrows measure.

 

cumulative = 
CALCULATE (
    [countrows],
    FILTER ( ALLSELECTED ( Table1 ), Table1[Date] <= MAX ( Table1[Date] ) )
)

Cumulative count of rows_1.jpg

 

Best Regards,

Herbert

HI Everyone...

 

I create my DAX to accumulativer count using all your suggest,  BUT, I need to know, what to modify if I apply a slicer to see accumulative by month or year.  Beacuse if I apply a slicer the running total dont start correctly, just work without any slicer apply.

 

Runing Total = CALCULATE(COUNT(RPT[SUBSCRIBER]),
ALL(RPT),RPT[ACTIVATION_DATE] <= EARLIER(RPT[ACTIVATION_DATE]))
 
Image 5.jpg
 
 
jPinhao
Advocate II
Advocate II

You have to calculate the sum of the value while filtering by all dates before the current MAX - current as in the current context, which will be the the day in a bar chart with a date on the axis for instance:

 

Cummulative = CALCULATE (
                     [number]
                     FILTER ( ALL([Date]), [Date] <= MAX([Date]) )
              )

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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