Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a temperature sensor that measures temprature every some minute and I want to choose the temperature value of the closest minute to the hour.How Can I do that?
For example, for 23 o'clock I want to choose the value of the closest minute to 23 o'clock.
Hi Samrawit21,
Create a measure to achieve the minimum interval using DAX below:
Minimun Interval Column = VAR temp = ABS(ABS(DATEDIFF(DATE(2018, 6, 9), MIN(Table1[Dateum]), SECOND)) - 23 * 60 * 60) VAR hour = ROUNDDOWN(temp / 3600, 0) VAR minute = ROUNDDOWN((temp - hour * 3600) / 60, 0) VAR second = MOD(temp, 60) RETURN TIME(hour, MINUTE, second)
Then obviously you can find the nearest date, just sort [Minimum Interval Column]
Regards,
Jimmy Tao
I want to write a function which chooses the temperature value of each hour. in the attached image of my previous question, you can see that the sensor measures every 5 minutes so the function should choose one value when the minute is close to the hour.
for example 06/09/2018 23:14:41 is close to 23:00 so the function must choose the temperature value of that time, and 06/09/2018 23:59:48 is close to 00:00:00(12:00 AM)...
I hope my question is clear enough.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
97 | |
80 | |
69 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |