Forum Discussion

paglioz3's avatar
paglioz3
New Member
5 years ago
Solved

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=
VAR MinDate = MIN ( 'CALENDAR'[Date] ) -- Saves the last visible date
RETURN CALCULATE ([value], 'CALENDAR'[Date] >= MinDate )
 
And this is the actual result:

datevalueprogressive_value
nov-19334838393
dic-19467835045
gen-20356630367
feb-20302026801
mar-20170423781
apr-201065222077
mag-20145711425
giu-2015569968
lug-2039878412
ago-2036974426
set-20729729


Any suggestion?

  • 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!

4 Replies

  • vanessafvg's avatar
    vanessafvg
    Community Champion
    you mean like this?

    progressive_value =
    VAR MinDate =
    MIN ( ALLSELECTED ( 'CALENDAR'[Date] ) ) -- Saves the last visible date
    RETURN
    CALCULATE ( [value], 'CALENDAR'[Date] >= MinDate )
    • paglioz3's avatar
      paglioz3
      New 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-msft's avatar
        v-kelly-msft
        Community 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,
        Kelly

        Did I answer your question? Mark my post as a solution!