Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello Community,
I am trying to calculate the time that a device is unavailable (dropped) and I need to create a measure to calculate the time difference (in seconds) based on the date slicer, but taking into account that the date of creation of the device can be greater than the minimum time of slicer, in such a case the difference would be between date of creation and end date of slicern. Also the time of destruction of the equipment can be earlier than the maximum date of the slicer, in that case the difference would be between the minimum time slicer or the date of creation and the date of device destruction.
All date fields are in the same table.
I have created a measure with variables step by step to obtain all the values but I can not do the subtraction of dates since the variable 'start_time_calculated', does not show me results. Idem for the 'end_time_calculated.
This is my table wiht the slicer and the fields for one device where I need to have the seconds down.
This is my measure approach:
@oscaag ,
Based on what I got, create a new measure
new measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = minx(allselected(Date),Date[Date])
return
sumx(Table, datediff(max([Created_date], _min), min([end_time], _max), day) )
Hello @amitchandak,
Thanks for your response but I miss the control over the time when we use the slicer, so the VARs to control it.
I attach a report with the data. ( Report )
I have create separated measures for my variables and create two tables one with the fields and one with the measure.
What I need is the durantion in second of the devices downs but taking into account that if the date selected in the slicer is greater than the starting of the down we should consider the slicer time for the result.
Many thanks.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 6 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 25 | |
| 16 | |
| 8 | |
| 7 | |
| 7 |