The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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.
User | Count |
---|---|
24 | |
9 | |
8 | |
7 | |
6 |
User | Count |
---|---|
29 | |
11 | |
11 | |
9 | |
9 |