Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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=
VAR MinDate = MIN ( 'CALENDAR'[Date] ) -- Saves the last visible date
RETURN CALCULATE ([value], 'CALENDAR'[Date] >= MinDate )
And this is the actual result:
date | value | progressive_value |
nov-19 | 3348 | 38393 |
dic-19 | 4678 | 35045 |
gen-20 | 3566 | 30367 |
feb-20 | 3020 | 26801 |
mar-20 | 1704 | 23781 |
apr-20 | 10652 | 22077 |
mag-20 | 1457 | 11425 |
giu-20 | 1556 | 9968 |
lug-20 | 3987 | 8412 |
ago-20 | 3697 | 4426 |
set-20 | 729 | 729 |
Any suggestion?
Solved! Go to Solution.
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,
Kelly
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
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]))
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,
Kelly
Did I answer your question? Mark my post as a solution!
Thanks!
Below the complete code:
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |