Forum Discussion
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!
9 Replies
- lbendlin
Super User
Your sample data is pretty hot... Looks like a sensor malfunction with buffer overflow.
Note: Your calendar has day level granularity. Your fact table has second level granularity. The join between them will not work.
- sivarajan21
Post Prodigy
Hi lbendlin sir,
Thanks for your quick response!
I didn't know that both tables different granularity would cause an issue.
Is there any way we can resolve this?
Also, can you help me with the measure please?
Thanks in advance!
marcorusso lbendlin Ahmedx Greg_Deckler amitchandak Jihwan_Kim
- lbendlin
Super User
Add a date column to the fact table.
I will help you with the measure once you provide better sample data.