Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.
Hi all!
In Power BI, I have a slicer with a date field. When a specific date is selected, if the date is between the selected date and 3 hours prior, the support should be displayed as 'on' with green color coding, otherwise 'off' with gray color coding.
What measure/column can I use to filter a single date in the slicer and see all the map elements with the corresponding color coding? When I use SELECTEDVALUE, it only shows the selected element in the slicer. I also tried using ALLSELECTED to exclude the date filter, but it doesn't seem to work. Can anyone help?
Thanks
Solved! Go to Solution.
Hello @Fern_21 ,
You can use a measure that calculates this logic dynamically based on the selected date.
SupportStatus =
VAR SelectedDate = SELECTEDVALUE('YourDateTable'[Date])
VAR ThreeHoursPrior = SELECTEDVALUE('YourDateTable'[Date]) - TIME(3,0,0)
VAR CurrentDate = MAX('YourDateTable'[Date]) // This gives you each row’s date in the visual
RETURN
IF(
NOT(ISBLANK(SelectedDate)) && CurrentDate >= ThreeHoursPrior && CurrentDate <= SelectedDate,"On","Off")
Once you have this measure, you can apply conditional formatting to your map elements:
Set "On" to green
Set "Off" to gray.
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!
Thank You
Dharmendar S
Hello @Fern_21 ,
You can use a measure that calculates this logic dynamically based on the selected date.
SupportStatus =
VAR SelectedDate = SELECTEDVALUE('YourDateTable'[Date])
VAR ThreeHoursPrior = SELECTEDVALUE('YourDateTable'[Date]) - TIME(3,0,0)
VAR CurrentDate = MAX('YourDateTable'[Date]) // This gives you each row’s date in the visual
RETURN
IF(
NOT(ISBLANK(SelectedDate)) && CurrentDate >= ThreeHoursPrior && CurrentDate <= SelectedDate,"On","Off")
Once you have this measure, you can apply conditional formatting to your map elements:
Set "On" to green
Set "Off" to gray.
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!
Thank You
Dharmendar S
Check out the May 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
75 | |
72 | |
71 | |
52 | |
48 |
User | Count |
---|---|
45 | |
38 | |
33 | |
31 | |
28 |