Forum Discussion

trotsale's avatar
trotsale
Regular Visitor
9 years ago
Solved

Calculating difference between rows by date

Hello!   I have a problem and here it is:   In my Power Bi I have a table with report which is getting data from local folder. A key is date, which is adding as a column on every refresh. It look...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi trotsale

     

    Try out this method. This method grabs the device ids from last month and subtracts them from device ids this month.

     

    DevicesByDate difference last month compared to this month = CALCULATE(COUNTROWS('Test');DISTINCT('Test'[Date]);DATEADD(DATESBETWEEN(Test[Date];STARTOFMONTH(Test[Date]);ENDOFMONTH(Test[Date]));-1;MONTH)) - CALCULATE(COUNTROWS('Test');DISTINCT('Test'[Date]);DATESINPERIOD(Test[Date];LASTDATE(Test[Date]);-1;MONTH)) 

     

    Best,

    Martin