Forum Discussion
Eesa
4 years agoFrequent Visitor
Calculate Dynamically Change Duration
Hi, I have a FLIGHT table below I want to use a slicer in my dashbord and when I adjust the slicer between any date/time, I want to get the total time in air. To imagine this I crea...
- Anonymous4 years ago
Hi Eesa ,
Try to create a new measure based on your origianl [Time in Air] measure.
Correct Measure with total = SUMX ( 'Table', [Time in Air] )Result is as below.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Eesa
4 years agoFrequent Visitor
I have re-written the measure to correct the error and works very well in matrix visual but it can't work with card visual as it gives me BLANK.
Here is the measure:
Time in Air =
var sdate = MINX(ALLSELECTED(CalendarDIM), CalendarDIM[Date])
var endate = MAXX(ALLSELECTED(CalendarDIM), CalendarDIM[Date]) + 1
var StartDate = MAX(MAX(Table[take off]), sdate)
var EndDate = MIN(MIN(Table[land on]), endate)
return CALCULATE( sumx(Table, DATEDIFF(StartDate, EndDate,MINUTE)) , FILTER(Table,
(Table[take off] >= StartDate && Table[take off] <= EndDate ) || (Table[land on] >= StartDate && Table[land on] <= EndDate )
Here is the result:
I'll really appreciate if anyone can help me fix this.
Thank you
Anonymous
4 years agoNot applicable
Hi Eesa ,
Try to create a new measure based on your origianl [Time in Air] measure.
Correct Measure with total =
SUMX ( 'Table', [Time in Air] )
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.