Forum Discussion
Shifting data backwards
- 3 years ago
OK, the measures you need are:
For + 3 days
+3 day = CALCULATE([Sum], FILTER(ALL(DTable), DTable[DayTable] = MAX(DTable[DayTable]) +3))Values at + 3 or less = CALCULATE ( [Sum], FILTER ( ALL ( DTable[DayTable] ), DTable[DayTable] > MAX ( DTable[DayTable] ) && DTable[DayTable] <= MAX ( DTable[DayTable] ) + 3 ) )Aggregated total at +3 = SUMX(DTable, [Values at + 3 or less])and if you want to display the +3days value at day level and the aggregated total at the total level:
Display at +3 = IF(ISINSCOPE(DTable[DayTable]), [+3 day], [Aggregated total at +3])So, for +18 days, you need:
Values at + 18 or less = CALCULATE ( [Sum], FILTER ( ALL ( DTable[DayTable] ), DTable[DayTable] > MAX ( DTable[DayTable] ) && DTable[DayTable] <= MAX ( DTable[DayTable] ) + 18 ) )Aggregated total at +18 = SUMX(DTable, [Values at + 18 or less])and if you want the +18 day values displayed ate Day level and the total aggragation at the total level:
+18 day = CALCULATE([Sum], FILTER(ALL(DTable), DTable[DayTable] = MAX(DTable[DayTable]) +18))Display at +18 = IF(ISINSCOPE(DTable[DayTable]), [+18 day], [Aggregated total at +18])Sample file attached
Sorry, I don't really understand what you need. If you only need the result for +3, just use the measure for + 3. Why do you need it to loop?
Hi PaulDBrown
Sorry for not beeing good in trying to explain.
I want to do calculations in each minus shift and since there will be many shifts (18) i do not want to do a measure for each minus shift
I am currently trying to do some sort of For /Next look (with help form an articlal here writen by Greg_Deckler )
- PaulDBrown3 years agoCommunity Champion
My question is: what do you need to display in the final visual? The +3 measure, or does it have to be dynamic based on a value the user selects from a slicer?
- Wresen3 years agoPost Patron
Sorry for the bad explenation .
In the last +3 the total value should be shown (added form +1 ,+2 and +3)
- PaulDBrown3 years agoCommunity Champion
Please provide a depiction of what you are after