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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
lebroyeur
Regular Visitor

Cumulative total and order

Hello everyone,

 

I am new to powerBI and I'm struggling to create a running total.

 

I only have one table, that looks like this :

 

                        SALES

MARKET A          100

MARKET A          50

MARKET B           30

MARKET C          600

MARKET C          400

MARKET D          700

 

What I need is a running total that would be ordered by number of sales per market (going from larger to smaller market), like this :

 

                          SALES.             RUN-TOTAL

MARKET A          150                  1850

MARKET B           30                   1880

MARKET C          1000                1000

MARKET D          700                  1700

 

Using quick measures, I have only been able to create running total ordered by market name, like this :

 

                          SALES.             RUN-TOTAL

MARKET A          150                  150

MARKET B           30                   180

MARKET C          1000                1180

MARKET D          700                  1880

 

I have also tried some things in DAX, but I am not familiar enough with it yet.

 

Thank you in advance !

 

1 ACCEPTED SOLUTION
wdx223_Daniel
Super User
Super User

2 REPLIES 2
wdx223_Daniel
Super User
Super User

mahoneypat
Microsoft Employee
Microsoft Employee

Here is a measure expression that gets your desired result.

 

RT Market =
VAR vThisMarket =
    MIN ( Sales2[Market] )
VAR vSummary =
    ADDCOLUMNS (
        ALLSELECTED ( Sales2[Market] ),
        "cSales",
            CALCULATE (
                SUM ( Sales2[Sales] )
            )
    )
VAR vThisSales =
    SUMX (
        FILTER (
            vSummary,
            Sales2[Market] = vThisMarket
        ),
        [cSales]
    )
RETURN
    SUMX (
        FILTER (
            vSummary,
            [cSales] >= vThisSales
        ),
        [cSales]
    )

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


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.