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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
dametreas
Frequent Visitor

Running Total "totaling" same day depreciation data

Hello,

 

I'm seeking help on an issue with running totals counting same day remaining balance. I have searched all over with no luck on how to show depretiation in contract value through running totals.

 

It works perfectly except for when i run into same date data. Any help would be greatly appreciated.

 

Remaining Balance Duration = CALCULATE(SUM('Invoice Log'[Remaining Balance]),FILTER('Invoice Log','Invoice Log'[Invoice Date]<=MAX('Invoice Log'[Invoice Date]) && 'Invoice Log'[Invoice Date]>=MAX('Invoice Log'[Invoice Date])))

 

Current calculation ^^ Source date \/ \/


data.PNG

5 REPLIES 5
v-stephen-msft
Community Support
Community Support

Hi @dametreas ,

 

If you want cumulative values, you could create the measure like

Remaining Balance Duration = CALCULATE(SUM('Invoice Log'[Remaining Balance]),FILTER(ALLSELECTED('Invoice Log'),'Invoice Log'[Invoice Date]<=MAX('Invoice Log'[Invoice Date]) ))

vstephenmsft_0-1663837936877.png

If this is not your expected result, please provide your expected result.

 

 

Best Regards,

Stephen Tao

 

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

Greg_Deckler
Super User
Super User

@dametreas So what is the problem with the highlighted value? Is it twice what it should be, half of what it should be? Lower than it should be, higher than it should be?


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler it is totalling both remaining balances for the same day to approx 1m+ instead of showing the "lesser" amount remaining on that day which would be 511k. I believe it has to do with the "Sum" portion of the formula in the running totals. 

I need it to show the depretiation of the contract value as invoiced. But since there is two invoices on one day the running total is calculating and adding both remaining balances on that day causing the spike and reporting 1m remaining instead of 511k.

double.PNG

 

Hopefully that clears it up a bit. Thank you for the reply!! 

@dametreas Can you post sample data that replicates the issue? Probably solvable.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler 

 

Current formula in power bi - 

Total Invoiced Duration = CALCULATE(SUM('Invoice Log'[Total Invoiced To Date]),FILTER('Invoice Log','Invoice Log'[Invoice Date] <=MAX('Invoice Log'[Invoice Date]) && 'Invoice Log'[Invoice Date] >=MAX('Invoice Log'[Invoice Date])))
 
Data pulled from Excel - Light yellow highlighted is the same day different invoice. Orange highlighted at end is the depretiation total contract amount left
Source data.PNG
 
Power Bi displayed data - Showing on the 23rd instead of showing the lowest amount after the invoiced amount its adding the remaining balance from excel source data column remaining balance together for that date. 
Power bi.PNG
 
I hope this is the information you were seeking. I appreciate your time!!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.