Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Measure for an Amount Calculation between two days/Columns

Hi all,


I'm struggling with a simple Measure.

I have the following Table:     -      

 

Now I want to calculate it the following way:  IF ( Netting Amount from the previous Day = 0, ('ResultIfTrue'), ('ResultIfFalse'))
For Example for the column 03/08/2021, I want to calculate: IF (Netting Amount from 02/08/2021 = 0 ....)
I do not know how to define the "Netting Amount from the previous Day". 

I hope you can help with answering this question and thanks a lot for your help!

 

BR

 




3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, thank you very much - it works with one exception. 
    We only have working days here and after a weekend there is a missing value. Do you know any solution that we show the value from friday and not not from sunday on monday?

    Thank you and BR

     

    • V-lianl-msft's avatar
      V-lianl-msft
      Community Support

      Try to modify the measure:

      Measure 2 = 
      var week_day = WEEKDAY(MAX('Table'[Date]),2)
      var current_ = SELECTEDVALUE('Table'[Date])
      return IF(week_day=1,
              CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'[Date]),'Table'[Date]=current_-3)),
              CALCULATE(SUM('Table'[value]),FILTER(ALLSELECTED('Table'[Date]),'Table'[Date]=current_-1)))