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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
bhelou
Responsive Resident
Responsive Resident

Running Total

Dear ,

 

Kindly i am trying to make a running total for the balance as shown in the image , 
it is based on a rank by vendor :

i have tried a quick measure it wont give a rnning total correct nor the total amount correct

1 - Running total measure : 

Balance running total in Rank_By_Vendor 2 =
CALCULATE(
    SUM('Test'[Balance]),
    FILTER(
        ALLSELECTED('Test'[Rank_By_Vendor]),
        ISONORAFTER('Test'[Rank_By_Vendor], MIN('Test'[Rank_By_Vendor]), DESC)
    )
)
 
2 : i have tried another measure :
Balance Running Total =
CALCULATE(
    SUM('Test'[Balance]),
    FILTER(
        (Test),
        Test[Vendor_Number] = LASTNONBLANK(Test[Vendor_Number],Test[Vendor_Number])
    )
)
 
// it gave me the balance correct but no running total .
 
balance in running total should be like this :
-130,725.00
-155,925.00
-173,250.00
etc........
 
 
Many thanks for your help .
 
running total.png
 
1 ACCEPTED SOLUTION

Dear @amitchandak 

Thank you for the measure , i made it as follow and worked 

Balance 1 =
CALCULATE(
SUM('Test'[Balance]),
FILTER(
ALLSELECTED(Test),Test[Rank_By_Vendor]<=MAX(Test[Rank_By_Vendor])))

Many thanks for your help 

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@bhelou , you need to have some unique value for running total.

 

Try like

 

CALCULATE(
SUM('Test'[Balance]),
FILTER(
ALLSELECTED('Test'[TransactionLine_Unique]),
'Test'[TransactionLine_Unique]>= MIN(TransactionLine_Unique))
)

 

or


CALCULATE(
SUM('Test'[Balance]),
FILTER(
ALLSELECTED('Test'[TransactionLine_Unique]),
'Test'[TransactionLine_Unique]<= MAX(TransactionLine_Unique))
)

 

or

 

CALCULATE(
SUM('Test'[Balance]),
FILTER(
ALLSELECTED('Test'),
'Test'[TransactionLine_Unique]<= MAX(TransactionLine_Unique))
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Dear @amitchandak 

Thank you for the measure , i made it as follow and worked 

Balance 1 =
CALCULATE(
SUM('Test'[Balance]),
FILTER(
ALLSELECTED(Test),Test[Rank_By_Vendor]<=MAX(Test[Rank_By_Vendor])))

Many thanks for your help 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.