Forum Discussion
2 slicers from same columns
- 5 years ago
Hi Anonymous ,
Base on before pbix file Iprovided, Try following steps:
Step1,Use the following measure ,create two begin_date:
begin_date1 = CALCULATE ( MAX ( 'Table'[begin_date] ), FILTER ( ALL ( 'Table' ), 'Table'[call_num] = MAX ( 'Table'[call_num] ) && 'Table'[status] = SELECTEDVALUE ( Slicer1[status] ) ) )begin_date2 = CALCULATE ( MAX ( 'Table'[begin_date] ), FILTER ( ALL ( 'Table' ), 'Table'[call_num] = MAX ( 'Table'[call_num] ) && 'Table'[status] = SELECTEDVALUE ( 'Slicer 2'[status] ) ) )Step 2, adjust before measure:
SILCERchoosedatediff = VAR TIME1 = CALCULATE ( MAX ( 'Table'[begin_date] ), FILTER ( ALL ( 'Table' ), 'Table'[status] = SELECTEDVALUE ( Slicer1[status] )&&'Table'[call_num]=MAX('Table'[call_num]) ) ) VAR TIME2 = CALCULATE ( MAX ( 'Table'[begin_date] ), FILTER ( ALL ( 'Table' ), 'Table'[status] = SELECTEDVALUE ( 'Slicer 2'[status] )&&'Table'[call_num]=MAX('Table'[call_num]) ) ) RETURN IF ( TIME2 > TIME1, DATEDIFF ( TIME1, TIME2, MINUTE ), DATEDIFF ( TIME2, TIME1, MINUTE ) )Step 3, adjust relationship:
And final will get want you want!
Wish it is helpful for you!
Best Regards
Lucien
Hi Anonymous ,
Not very clearly.
Could you pls provide a sample?
Just for the table ,Slicer A choose value(begin_date):
| 2021-06-25 13:05:22 |
And Slicer B choose value(begin_date):
| 2021-06-25 14:25:02 |
And you want to get the time between the two time?
Best Regards
Lucien
Hi v-luwang-msft,
here some real data
| call_num | begin_date | end_date | status |
| 2-161130-0001 | 11/30/2016 0:10 | 11/30/2016 0:10 | 911 |
| 2-161130-0001 | 11/30/2016 0:10 | 11/30/2016 0:10 | trait |
| 2-161130-0001 | 11/30/2016 0:10 | 11/30/2016 0:12 | cree |
| 2-161130-0001 | 11/30/2016 0:12 | 11/30/2016 0:19 | repa |
| 2-161130-0001 | 11/30/2016 0:19 | 11/30/2016 0:24 | rout |
| 2-161130-0001 | 11/30/2016 0:24 | 11/30/2016 0:44 | lieu |
| 2-161130-0001 | 11/30/2016 0:44 | 11/30/2016 1:11 | tran |
| 2-161130-0001 | 11/30/2016 1:11 | 11/30/2016 1:24 | dest |
| 2-161130-0001 | 11/30/2016 1:24 | 11/30/2016 1:40 | libe |
| 2-161130-0001 | 11/30/2016 1:40 | 11/30/2016 2:04 | reto |
| 2-161130-0001 | 11/30/2016 2:04 | 11/30/2016 3:10 | comp |
| 2-161130-0001 | 11/30/2016 3:10 | clas |
I need people to be able to have intervals between any status :
For example, I need people select in a first dropdown the status "tran" and in a second dropdown choose the status "comp"(in the 2nd dropdown, the status "tran" should not be displayed. Once the 2 status are selected, interval between the 2 begin_date should be automatically calculated for every single call_num.
Is that clear enough?
thank you,
regards,
Xavier