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 September 15. Request your voucher.

Reply
edge9999
Frequent Visitor

Running Total for Charges

I have a faily simple problem (I think) that i just cant get my head around.   We have numerous transaction lines, each with a dollar amount and a truck associated wtih them.    I'm trying to do a quick matrix where the Revenue per truck is summed up (easy part), and then the fees for that truck are calculated.    If the revenue is 25-150K the Fee is $300, if the Revenue is Greater than 150K, the fee is $500 (can also display this).   But the part i can't get is a total of the fees.   I need seom sort of running total on the column titled total in the matrix shown below.    I think i understand why the totals for the 25-150k and Over 150K columns dont work, but i just need to get some way to come up with the total fee and display it.   Any feedback is appreciated.

 

edge9999_0-1736282877756.png

 

Formulas in columns 1, 2 and 3 repectively

MS_LINE_AMOUNT = sum(VW_TICKET_LINEITEMS[AMOUNT])
MS_25_150K = if([MS_LINE_AMOUNT] > 25000 && [MS_LINE_AMOUNT] <= 150000,300,0)
MS_OVER150K = if([MS_LINE_AMOUNT] > 150000 ,500,0)
 
 

 

6 REPLIES 6
vivek31
Resolver II
Resolver II

HI @edge9999 ,

 

you can try this formula to find running total for charges

running total = 
var current_unit = MAX(VW_TICKET_LINEITEMS[Unit])
RETURN
CALCULATE(SUMX(FILTER(ALL(VW_TICKET_LINEITEMS),
                      VW_TICKET_LINEITEMS[Unit] <= current_unit),[Total Charges]))

vivek31_0-1736314084163.png

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

Anonymous
Not applicable

Hi, @edge9999 

 

You can try the following methods.

 

Measure 25_150K = SUMX(VW_TICKET_LINEITEMS,[MS_25_150K])
Measure OVER150K = SUMX(VW_TICKET_LINEITEMS,[MS_OVER150K])
Measure Total = [Measure 25_150K]+[Measure OVER150K]
Total = SUMX(FILTER(ALL(VW_TICKET_LINEITEMS),[Unit]<=MAX(VW_TICKET_LINEITEMS[Unit])),[Measure Total])

 

vzhangtinmsft_0-1736315032834.png

Is this the result you expected?

 

Best Regards,

Community Support Team _Charlotte

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

lbendlin
Super User
Super User

Consider using a Quick Measure for that. It has a "Running Total"  pattern that is pretty solid.

 

lbendlin_0-1736293150623.png

 

I think i may have missed explaining a piece.    There are multiple transactions for each Unit which means that in the visual above, the Revenue is actually the sum of many records.    I dont think i can use SUMX as the Revenue needs to be summed for the period before I can determine what rate to apply (either the $300 or the $500).    I also tried adding a quick measure for a running total with no luck.

 

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Please show the expected outcome based on the sample data you provided.

Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

I have attached some sample data.  The first tab is raw data.  The Calc tab is what i'm trying to create in Power BI

 

Link 

 

 

Thanks

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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.