Forum Discussion
Highlight specific rows in a table visual that meets a condition
- 6 years ago
Try wrapping the prevdayfilter column in a selectedvalue(). Even if there is just 1 value and 1 column in a table you still cant refer directly to the table, instead you need to do an aggregation on the column to get the appropriate value.
highlightRow = VAR Filter = SELECTEDVALUE( prevDayFilter[Column] ) Return IF (SELECTEDVALUE(genscape_maintenance_events[updateDate]) >= Filter, 1,0)
/ J - 6 years ago
Just choose select the column you want the table sorted by, then apply either asc or desc sorting:
Whatever settings you have applied when you publish to Power BI Service will be the default for the users when they access the report.
/ J
Hi tex628: Thanks a lot for your continued support in getting to this solution! I had to tweak a little to update the measure:
highlightRow = VAR x= SELECTEDVALUE(prevDayFilter[prevDayFilter])
Return
IF( SELECTEDVALUE(genscape_maintenance_events[updateDate]) >= x, 1 , 0 )
Best, Sohana 🙂
Hi tex628 & all: Good day! There is an issue I found later. The prevDayFilter as
= Date.AddDays(Date.From(DateTime.LocalNow()), -1)
shows right date as 9/15/2020 [today is 9/16/2020]. As I started to do the data 'Refresh', first 2 days it works fine- highlights rows with update date as today and yesterday. Then from 3rd day on it highlights earlier days rows too! Like today as I did the data refresh, it highlighted rows with update date of today [9/16/2020], yesterday [9/15/2020] and also 9/14/2020.
The measaure is:
highlightRow = VAR x= SELECTEDVALUE(prevDayFilter[prevDayFilter])
Return
IF( SELECTEDVALUE(genscape_maintenance_events[updateDate]) >= x, 1 , 0 )
Not sure why it's highlighting rows with 'updateDate' earlier than previous day [yesterday]! Any help is highly appreciated!