Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
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:
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 33 | |
| 33 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 67 | |
| 45 | |
| 30 | |
| 26 |