Forum Discussion
Date Slicer
Thank you for your response. But seems like it's not working.
My expectation is, to select Date_exam and time range 1/15/2024-1/17/2024. The table chart only displays 1 row satisfied with the slicer (yellow row)
Thanks for the reply from Kedar_Pande and rajendraongole1 , please allow me to provide another insight:
Hi, Anonymous and Amyries
Regarding the issue you raised, my solution is as follows:
1.Firstly, if you need to use the time from dim_date as a slicer, I recommend disconnecting the links between the two tables. Otherwise, the slicer will directly affect the other two tables.
2.Secondly, similar to rajendraongole1 , create a calculated table to serve as the dimension slicer.
DateType =
DATATABLE(
"Date_Type", STRING,
{
{"Date_exam"},
{"Date_release"}
}
)
3.Next, apply the following measures as filters in the visual object:
MEASURE =
VAR cc1 =
DISTINCTCOUNT ( 'DateType'[Date_Type] )
VAR type1 =
VALUES ( 'DateType'[Date_Type] )
VAR time1 =
VALUES ( 'dim_date'[Date] )
RETURN
IF (
ISFILTERED ( 'DateType'[Date_Type] ),
IF (
cc1 = 1,
IF (
(
"Date_exam"
IN type1
&& MAX ( 'Dile_fact'[Date_exam] ) IN time1
)
|| (
"Date_release"
IN type1
&& MAX ( 'Dile_fact'[Date_release] ) IN time1
),
1,
0
),
IF (
MAX ( 'Dile_fact'[Date_exam] )
IN time1
&& MAX ( 'Dile_fact'[Date_release] ) IN time1,
1,
0
)
),
1
)
4.Finally, here are the results, which I hope will meet your needs:
Please find the attached pbix relevant to the case.
Best Regards,
Leroy Lu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.