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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jbuzaglu
Frequent Visitor

Running Total by Store (instead of by date)

Basically I have SKUs by different stores, and need the running total from most sold to least sold.

 

jbuzaglu_0-1677603847748.png

From the screenshot, I need to have the running total of the "Unit Weight", descending. And reseting by each store name. Aditionally, I can't use the "sum" function on Unit Weight since it is a mesure from a live connection (tabular model).

 

Any help or leads on this would be GREATLY appreciated

9 REPLIES 9
FreemanZ
Super User
Super User

hi @jbuzaglu 

The logic is very similar. Supposing you have a table like:

FreemanZ_0-1677680645079.png

try to plot a table visual with the Store column and a measure like:

Measure = 
SUMX(
    FILTER(
        ALL(TableName),
        TableName[Sales]>=MAX(TableName[Sales])
    ),    
    TableName[Sales]
)

 

it worked like:

FreemanZ_1-1677680702053.png

When I try to create the measure, I get this error. Basically it is not a table but measures

 

jbuzaglu_0-1677682495061.png

 

And aditionally, I can't use the sum function on a measure. This is why it is complicated to me, I want this value to change as I slice thorugh different dates.

 

Thank you for replying

 

hi @jbuzaglu 

could you please abstract your case and reproduct it with simplified sample dataset?

I can certainly replicate it, the only problem is that this is a live connection, and this is the complexity of my case.

 

But in simplified fashion I have the following:

 

Store    SKU     Units Sold      Unit Weight         Running Total (Desired Measure)

A          01A          4                 4/13=30.8%                     30.8%

A          02B          4                 4/13=30.8%                     61.6%

A          03B          3                 3/13=23.1%                     84.7%

A          02A          2                 2/13=15.3%                    100%

 

B          01A          5                  5/8=62.5%                       62.5%

B          09A          2                  2/8=25%                          87.5%

B          02B          1                  1/8=12.5%                       100%

 

C          01A         3                  3/6=50%                            50%

C          02B         2                  2/6= 33.3%                       83.3%

C          03B         1                  1/6=16.67%                      100%

 

I would like the measure to change as I change dates, and loads new data thorugh my live connection.

 

Thank you FreemanZ for your kind help

hi @jbuzaglu 

try to plot a table visual a measure like:

RT = 
SUMX(
    FILTER(
        ALL(TableName),
        TableName[Store] = MAX(TableName[Store])
        &&TableName[UnitsSold]>=MAX(TableName[UnitsSold])
    ),
    TableName[Weight]
)

FreemanZ_0-1677762874598.png

 

Thank you for your response, I strongly think this is the way, however I get this error since the units sold is a changing measure depending on date:

jbuzaglu_0-1677772628006.png

 

Any clue how I can overcome this error?

 

Again, thank you for your patience regarding this.

 

if  you prefer CALCULATE, try like:

Measure2 = 
CALCULATE(
    SUM(TableName[Sales]),
    FILTER(
        ALL(TableName),
        TableName[Sales]>=MAX(TableName[Sales])  
    )
)

 

FreemanZ_2-1677680881439.png

 

jbuzaglu
Frequent Visitor

Thank you for replying andhiii079845, yes except it would be decresing from highest store units to lowest. So in the example you sent, store C would be viceversa how it is performing the running total. Any help I would be forever greateful. 

andhiii079845
Solution Sage
Solution Sage

Do you want a Table like this? Unit weight is a running total (cummaltive) per store?

StoreUnit per StoreUnit CYUnit weight
A7834% (3/78)
A7838% (6/78)
A78312% (9/78)
C7834% (3/78)
C78612% (9/78)
C782442% (33/78)




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

Proud to be a Super User!




Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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