Forum Discussion
AgataJ
Helper II
1 year agoSubtracting Running Total from first available value in a table
Good morning, I am working on such calculations: I have a column with Hours and Hours Used. For Hours used I need to calculate Running Total, what I have a DAX for it no problem. My problem starts...
- 1 year ago
Try this
Answer = // get first date var myfirstdate = CALCULATE( MIN(yourdata[Date]), ALl(yourdata) ) // get hours for first date var myfirstvalue = CALCULATE( SUM(yourdata[Hours]), ALL(yourdata), yourdata[Date] <= myfirstdate) // get date for current row in visual var mydate = SELECTEDVALUE(yourdata[Date]) // get running total for row var runningtotal = CALCULATE( SUM(yourdata[Hours used]), ALL(yourdata), yourdata[Date] <= mydate) RETURN // deduct running toral from first value myfirstvalue - runningtotalPlease click the [accept solution] and thumbs up buttons. Thank you
speedramps
Super User
1 year agoThanks AgataJ
Your new issue is a bit vague and a new problem that will require a new solution.
Please raise a new ticket rather than append to this one, otherwise uit gets confussing which is which.
If you quote @speedramops then I wil receive an automatic notification.
In you new ticket please provide:-
- input data (as a table not picture).
- desired output
- step by step description
- use meaningful column names
- keep it simple and omit anything not related to the problem
Take care to use the same column names in the input, output and description.
Use Power Bi terminnology. If you mean Slicer then say slicer and not Filter.
You will get quicker and better replies if you take the time and effort to ask clear and comprehensive questions with example data.
Thank you