Forum Discussion

Excellove15's avatar
Excellove15
Iron Contributor
Oct 25, 2024

Create a dax to find time difference

Hi,

 

I have a requirement to create a dax for below data:

we need to find the difference between setpoint temp column and current temp column:

Then make sure that difference falls in range of > -1 and less than 1. If the above condition is met then 1(which means it meets the set point) else zero(not met the setpoint).

Finally we need to count those that has not met the setpoint for more than 6 hours(Updatedon column).

In simple terms, logic for this dax is 'Any that has not reached set point for more than 6+ hours'.

 

PFA file here Heatsense.pbix

Please advise!

 

Thanks in advance!

SergeiBaklan  

  • Hi SergeiBaklan Sir,

     

    Just to update on the below, I have found a dax measure to find the difference between the setpoint temp and current temp.

     

    Delta = abs(AVERAGE(HeatSense_Device[SetPointTemp])-AVERAGE(HeatSense_Device[CurrentTemp]))

     

    My initial requirements mentioned above were :

    After finding the difference, make sure that difference(which is delta here) falls in range of > -1 and less than 1.

    If the above condition(-1<Delta<1) is met then 1(which means it meets the set point) else zero(not met the setpoint).

    Final & important thing, we need to count those that has not met the setpoint for more than 6 hours(Updatedon column).

    In simple terms, logic for this dax is 'Any that has not reached set point for more than 6+ hours'.

     

    PFA updated file here Heatsense - Copy.pbix

    I am struggling to find the above,please advise.

     

    Thanks in advance!

    SergeiBaklan 

  • Excellove15's avatar
    Excellove15
    Iron Contributor

    Hi SergeiBaklan Sir,

     

    Just to update on the below, I have found a dax measure to find the difference between the setpoint temp and current temp.

     

    Delta = abs(AVERAGE(HeatSense_Device[SetPointTemp])-AVERAGE(HeatSense_Device[CurrentTemp]))

     

    My initial requirements mentioned above were :

    After finding the difference, make sure that difference(which is delta here) falls in range of > -1 and less than 1.

    If the above condition(-1<Delta<1) is met then 1(which means it meets the set point) else zero(not met the setpoint).

    Final & important thing, we need to count those that has not met the setpoint for more than 6 hours(Updatedon column).

    In simple terms, logic for this dax is 'Any that has not reached set point for more than 6+ hours'.

     

    PFA updated file here Heatsense - Copy.pbix

    I am struggling to find the above,please advise.

     

    Thanks in advance!

    SergeiBaklan 

Resources