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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Running total/cumulative sum per category

Hi guys, 

 

I want to do a cumulative sum for each category (partner_warehouse_id here) :

 

Sniv_0-1657102464664.png

 

Here is what i did for the moment :

 

Nombre d'inscriptions cumulé = CALCULATE(SUM ( 'Nombre d''inscriptions 2'[Nombre] ),FILTER(ALL('Nombre d''inscriptions 2'),'Nombre d''inscriptions 2'[partner_warehouse_id] = MAX('Nombre d''inscriptions 2'[partner_warehouse_id])&&'Nombre d''inscriptions 2'[signup_date]<=EARLIER('Nombre d''inscriptions 2'[signup_date])))
 
thanks for your help
1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Thanks for reaching out to us.

In column dax code, please try

Nombre d'inscriptions cumulé =
CALCULATE (
    SUM ( 'Nombre d''inscriptions 2'[Nombre] ),
    FILTER (
        ALL ( 'Nombre d''inscriptions 2' ),
        'Nombre d''inscriptions 2'[partner_warehouse_id]
            = EARLIER ( 'Nombre d''inscriptions 2'[partner_warehouse_id] )
            && 'Nombre d''inscriptions 2'[signup_date]
                <= EARLIER ( 'Nombre d''inscriptions 2'[signup_date] )
    )
)

 Usually, max () is used to get the current row in measure dax code.

 

Best Regards,

Community Support Team _Tang

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

View solution in original post

3 REPLIES 3
v-xiaotang
Community Support
Community Support

Hi @Anonymous 

Thanks for reaching out to us.

In column dax code, please try

Nombre d'inscriptions cumulé =
CALCULATE (
    SUM ( 'Nombre d''inscriptions 2'[Nombre] ),
    FILTER (
        ALL ( 'Nombre d''inscriptions 2' ),
        'Nombre d''inscriptions 2'[partner_warehouse_id]
            = EARLIER ( 'Nombre d''inscriptions 2'[partner_warehouse_id] )
            && 'Nombre d''inscriptions 2'[signup_date]
                <= EARLIER ( 'Nombre d''inscriptions 2'[signup_date] )
    )
)

 Usually, max () is used to get the current row in measure dax code.

 

Best Regards,

Community Support Team _Tang

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

amitchandak
Super User
Super User

@Anonymous , try with a small change

 

Nombre d'inscriptions cumulé = CALCULATE(SUM ( 'Nombre d''inscriptions 2'[Nombre] )
,FILTER(ALL('Nombre d''inscriptions 2'),'Nombre d''inscriptions 2'[partner_warehouse_id] = MAX('Nombre d''inscriptions 2'[partner_warehouse_id])
&&'Nombre d''inscriptions 2'[signup_date]<=MAX('Nombre d''inscriptions 2'[signup_date])))

Anonymous
Not applicable

Unfortunately, it's not working @amitchandak 

 

Sniv_0-1657199869447.png

 

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Kudoed Authors