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 everyone,
I'd like to show all the lines which have an overlap period with the selected periode on the slicer.
I know I used to succeed this before, but I'm not able to find it back and I'm failing doing it again.
This version is a simplified version of the final behaviour, but this is where something is going wrong.
In this example, I'm trying to get a 1 flag for eah line that has the Date_debut between the dates selected in the slicer.
Showing the MIN and MAX part of the slicer in a measure works fine.
But as soon as I'm refering to a line, I'm losing the values of the slicer, what am I doing wrong?
For the 1st line : 01/07/2022 IS NOT <= 13/05/2022, but it keeps returning 1
Solved! Go to Solution.
My coworker disabled the relation between the slicer and the table...
Never mind, sorry for the inconveniance !
My coworker disabled the relation between the slicer and the table...
Never mind, sorry for the inconveniance !
Hi @Anonymous ,
Please try below steps:
1. below is my test table
Table:
Date:
create with below dax formula
Date = CALENDAR(DATE(2020,01,01),DATE(2023,01,13))
2. create a measure with below dax formula
Test overlap =
VAR min_date =
MINX ( 'Date', [Date] )
VAR max_date =
MAXX ( 'Date', [Date] )
VAR cur_date =
SELECTEDVALUE ( 'Table'[Date_debut] )
VAR tmp =
CALENDAR ( min_date, max_date )
RETURN
IF ( cur_date IN tmp, 1, 0 )
3. add a slicer with "Date" table field, add a table visual with "Table" field and measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Your Max slicer says 11/07/2023 in the details