Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Refer to previous value within a Matrix

Hey guys,

 

last 2 columns is my issue. I need the "Backlog Line not put away prior day" Value to calculate my SLAs. All columns values are measures. "Backlog Line not put away prior day" uses Today()-1 which is fine but with how PBI works it does not show any value for prior day as each row is displayed for one specific Date. So what i am asking is there a way to transfer my "No Putaway" (which is the same as the Backlog) from a prior Date to the next Date? And if not do you have any other ideas on how to achive this kind of matrix.

 

 

  • Hi 
    you can use the below, this should solve your problem.
     
    yesterday =
    VAR yd = MAX('calendar'[Date]) -1
    RETURN
    CALCULATE(
    [measure],
    ALL('calendar'), 'calendar'[Date] = yd
    )
  • parry2k's avatar
    parry2k
    7 years ago

    Anonymous you can simply use previousday function as mentioned previously

     

    Prev Day = 
    CALCULATE( [Measure], PreviousDay( Calendar[Date] ) )

7 Replies

  • Anonymous you can use previousday function to get the value from previous date. It is adviseable to add date dimension in your model if you already don't have one.

  • Mariusz's avatar
    Mariusz
    Community Champion
    Hi 
    you can use the below, this should solve your problem.
     
    yesterday =
    VAR yd = MAX('calendar'[Date]) -1
    RETURN
    CALCULATE(
    [measure],
    ALL('calendar'), 'calendar'[Date] = yd
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      This is genious! Thx. Works great. I am new to PBI still got a lot to learn.

      • parry2k's avatar
        parry2k
        Super User

        Anonymous you can simply use previousday function as mentioned previously

         

        Prev Day = 
        CALCULATE( [Measure], PreviousDay( Calendar[Date] ) )