Forum Discussion
paglioz3
5 years agoNew Member
problem with total progressive
Hi all, I need to calculate a progressive value in base of the period filtered by user, from older to laster, but the result sum start from the last date. I use the script: progressive_value= V...
- 5 years ago
Hi paglioz3 ,
Try below expression:
progressive_value = VAR MinDate = MINX ( ALLSELECTED ( 'CALENDAR'),'CALENDAR'[Date] ) -- Saves the last visible date RETURN CALCULATE ( [value], 'CALENDAR'[Date] >= MinDate )Best Regards,
KellyDid I answer your question? Mark my post as a solution!
vanessafvg
5 years agoCommunity Champion
you mean like this?
progressive_value =
VAR MinDate =
MIN ( ALLSELECTED ( 'CALENDAR'[Date] ) ) -- Saves the last visible date
RETURN
CALCULATE ( [value], 'CALENDAR'[Date] >= MinDate )
progressive_value =
VAR MinDate =
MIN ( ALLSELECTED ( 'CALENDAR'[Date] ) ) -- Saves the last visible date
RETURN
CALCULATE ( [value], 'CALENDAR'[Date] >= MinDate )
- paglioz35 years agoNew Member
Thank's but no, with ALLSELECTED funtion returned an error (
the MIN function accepts only a column reference as an argument
)for completeness, the measure [value] = calculate(sum([import]))
- v-kelly-msft5 years agoCommunity Support
Hi paglioz3 ,
Try below expression:
progressive_value = VAR MinDate = MINX ( ALLSELECTED ( 'CALENDAR'),'CALENDAR'[Date] ) -- Saves the last visible date RETURN CALCULATE ( [value], 'CALENDAR'[Date] >= MinDate )Best Regards,
KellyDid I answer your question? Mark my post as a solution!
- paglioz35 years agoNew Member
Thanks!
Below the complete code:
progressive_value =VAR MinDate = MINX ( ALLSELECTED ( 'CALENDAR'),'CALENDAR'[Date] ) -- Saves the last visible datevar MaxDate = MAX ('IND'[Date])var Value= CALCULATE (IND[Amount])RETURNCALCULATE ( Value, 'CALENDAR'[Date] >= MinDate, 'CALENDAR'[Date] <= MaxDate )