Forum Discussion
Recursive DAX Calculated Column
amitchandak I've already figured out the logic you sent to me in the power bi file, calculating the hours over capacity and hours under capacity. Is there something I'm missing from your attached file or did you just redo what I did? I'm confused at this point, because for a second I thought you solved my problem, but that is not the case.
Can let me know the final column values you need on the file I shared back.
- amitchandak6 years agoSuper User
Are you looking for this one :
Cap = if([HoursRemaining]<[HoursPlanned],[HoursRemaining],[HoursPlanned])This should be a column
- Lyssillic6 years agoHelper I
Date HoursPlanned HoursRemaining HoursRemainingCappedAtHoursPlanned HoursUnderCapacity HoursOverCapacity 3/8/20 16 20 16 0 4 3/9/20 16 30 16 0 14 3/10/20 16 19 16 0 3 3/11/20 16 5 5 11 0 3/12/20 16 20 16 0 4 - Lyssillic6 years agoHelper I
Thank you, but what about the solution to adding up/subtracting the hours over capacity to the next days? Do you know how to solve this? amitchandak
- amitchandak6 years agoSuper User
This how I provided the last two measure on initial data
Diff = CALCULATE(sum(Sheet1[HoursPlanned])-sum(Sheet1[HoursRemaining]),FILTER('Date','Date'[Date]<=MAX('Date'[Date])))
//last two measure in you table
over cap cal = IF([Diff]<0,[Diff]*-1,0)
Over under cap = if([Diff]>0,[Diff],0) - Lyssillic6 years agoHelper I
amitchandak I know, that's just giving me the same data that I started with. It's not recursively adding up the hours over capacity and subtracting the hours under capacity.