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
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
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.