Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreShape the future of the Fabric Community! Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions. Take survey.
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
User | Count |
---|---|
93 | |
92 | |
85 | |
83 | |
49 |
User | Count |
---|---|
150 | |
142 | |
112 | |
73 | |
55 |