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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
andywil456
Advocate II
Advocate II

add value on row above on dashboard

I'm trying to create a visual that will show a running balance. Here is a screenshot summarizing the data showing the balance for each category, but i really cannot find a solution how to create a running balance. Untitled.png

I have tried creating a table and using the following fomula such as 

cashflow = CALCULATE(sum('cust and supplier cashflow'[Amount_1]),FILTER('cust and supplier cashflow',CONTAINS('master payment category','master payment category'[index],'cust and supplier cashflow'[index]))).

This only puts the total amount of £69117.74 on each payment category line. 

1 ACCEPTED SOLUTION

@andywil456

 

Please refer to below screenshot for relationships between the two tables I set up. My index values are numbers.

I’ve shared my Power BI file here. You can take a look at it if needed.

add value on row above on dashboard_1.jpgadd value on row above on dashboard_2.jpg

 

Best Regards,

Herbert

View solution in original post

16 REPLIES 16
andywil456
Advocate II
Advocate II

Thank you @Habib and @v-haibl-msft,

 

I have now got this to work, i was creating this as a new column and not as a measure.Untitled.jpg

However it has brought me to another query/issue.

I have set up a monthly slicer which, the 'Amount 2' column will change as per my selection, however the 'Rolling Balance' measure will not change. Is there anyway of making this change with my slicer/ chiclet slicer selection?

 

Habib
Continued Contributor
Continued Contributor

What formula you have applied. It should work without any issue for any slicer.

rolling balance = CALCULATE(SUM('total cashflow'[Amount 2]), FILTER(ALL('total cashflow'),'total cashflow'[index] <= MAX('total cashflow'[index])))

Habib
Continued Contributor
Continued Contributor

Don't use filter in your formula. please try to use the formula which I shared earlier. 

Hi @Habib,

 

I have applied your formula

Measure 2 = CALCULATE(SUM('total cashflow'[Amount 2]),(ALL('customer payment data'),'customer payment data'[index]<= EARLIER('customer payment data'[index])))

 

but i'm getting the following error message

 

A single value for column 'index' in table 'customer payment data' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

 

My total cashflow table has got mutliple lines per index category.

When i apply your formaula to my overivew table 

measure = CALCULATE(SUM(Table1[total amount]),ALL(Table1),Table1[Index]<= EARLIER(Table1[Index]))

 

I get the following error message

EARLIER/EARLIEST refers to an earlier row context which doesn't exist.

Habib
Continued Contributor
Continued Contributor

Are you adding new measure or new column. It should be new column.

I was initially adding it has a new measure, i have now applied the formula as a column but getting the following resultUntitled.jpg

 

and when i use the cashflow table amount, it's not adding the previous balanceUntitled.jpg

@andywil456

 

Please refer to below screenshot for relationships between the two tables I set up. My index values are numbers.

I’ve shared my Power BI file here. You can take a look at it if needed.

add value on row above on dashboard_1.jpgadd value on row above on dashboard_2.jpg

 

Best Regards,

Herbert

v-haibl-msft
Microsoft Employee
Microsoft Employee

@andywil456

 

It should work with following formula.

Running Total = 
CALCULATE (
    SUM ( 'cust and supplier cashflow'[Amount_1] ),
    FILTER (
        ALL('master payment category'),
        'master payment category'[index] <= MAX ( 'master payment category'[index] )
    )
)

add value on row above on dashboard_1.jpg

 

Best Regards,

Herbert

Hi @v-haibl-msft,

I'm still trying to apply you formula, on the example you have create how are you're relationships between the two tables set up? and are your index values as numbers or text? 

 

Hi @v-haibl-msft,

I'm still trying to apply you formula, on the example you have create how are you're relationships between the two tables set up? and are your index values as numbers or text? 

 

Thank you @v-haibl-msft,

I have applied your formula but i'm still not getting the correct result.Untitled.jpg

Habib
Continued Contributor
Continued Contributor

@andywil456 I have tried to produce data like yours and applied below formula. Only one change I have used table name CustCashFlow

 

RunningTotal = CALCULATE(SUM(CustCashFlow[amount_1]),ALL(CustCashFlow),CustCashFlow[Index]<=EARLIER(CustCashFlow[Index]))

 

It worked for me. Please refer to below.

 

7-25-2016 6-10-14 PM.png

 

 

Habib
Continued Contributor
Continued Contributor

First you need give sorting order for your categories in separate column and it should be a nubmer. Then you should use CALCULATE function. Somethig like below. Here PaymentCategoryOrdNo is new ordering Column

 

RunningTotal = CALCULATE(SUM(amount),all(Payment Category), PaymentCategoryOrdNo <=PaymentCategoryOrdNo ))

 

You can find help on below thread as well

 

http://community.powerbi.com/t5/Desktop/Running-Total/m-p/51014#M20441

@Habib,

 

I have applied your calculation but i'm not sure what i have done wrong, its not giving the desired output. Untitled.jpg

Close up on the formula and running balanceUntitled.jpg

Habib
Continued Contributor
Continued Contributor

Hi @andywil456 There was a mistake in syntax. Apologies for that.

 

Please refer to below scenario.... I have created data set as below

 

OrdNoPayment CategoryAmount
1Prepayment450
2Immediate300
330 Days from Invoice900
445 Days from Invoice590

 

I added new column with following formula

 

RunningTotal = CALCULATE(SUM(Data[Amount]),ALL(Data), Data[OrdNo] <= EARLIER(Data[OrdNo]))

 

and it worked now.

 

step4.png

 

 

 

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.