March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
115 | |
76 | |
57 | |
52 | |
44 |
User | Count |
---|---|
167 | |
117 | |
63 | |
57 | |
50 |