Forum Discussion
Highlighting new items
- 3 years ago
Hi Anonymous
I just used your code in the example file I created for you and it highlights in red anything that is more than 7 days in the past
You said you wanted to highlight things posted in the past 7 days, not more than 7 days ago?
To highlight things in the past 7 days you want to use greater than or equal to in the code, the code you posted is using less than or equal to
New = IF(SELECTEDVALUE('Issues'[Date Reported]) <= TODAY()-7, "red")
regards
Phil
Hi Anonymous
Download example PBIX file with the code and data below
You can create a measure like this
New = IF(SELECTEDVALUE('DataTable'[Date Reported]) >= TODAY()-7, "#ADD8E6")
which sets a color defined by the HEX code #ADD8E6 (pale blue) and this can be used in a Conditional Formatting rule to change the background color of the cells in the table. Set the HEX code to anything you like
More color codes here https://htmlcolorcodes.com/
After creating the measure, add the CF rule
Using these settings for the rule
Resulting in this
NOTE You have to create a separate CF rule for each column (Value), PBI won't let you set a rule for an entire row.
Regards
Phil
- Anonymous3 years agoNot applicable
with your measure
New = IF(SELECTEDVALUE('Issues'[Date Reported]) <= TODAY()-7, "red") and steps you provided It doesn't highlight anything. It needs to highlight the past 7 day's period- PhilipTreacy3 years agoSuper User
Hi Anonymous
So you've created the Conditional Formatting rule after creating the measure?
Without seeing your data and the rule you wrote I can't say for sure what is wrong. Can you supply your file or at least the data (as text or table - not an image) you are running the CF rule against?
regards
Phil
- Anonymous3 years agoNot applicable
Here is the .pbix It didnt allow me to attach here so had to upload somewhere else.