Forum Discussion
Anonymous
5 years agoNot applicable
2 slicers from same columns
Hi folks, I'm facing problem that I am unable to solve by myself, I need you. I have a table call_status like that call_id status begin_date end_date 1 open 2021-06-25 13:05:22...
- 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
v-luwang-msft
5 years agoCommunity Support
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
Anonymous
5 years agoNot applicable
Many thanks for you help!! you rock!