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
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
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 🙂
- Anonymous6 years agoNot applicable
Hi tex628 Thanks a lot for your support! 🙂
- tex6286 years ago
Community Champion
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 - Anonymous6 years agoNot applicable
Hi all, tex628 : I have 1 more question on this thread.
The table visual I have by default gets sorted with the first Column, pipeline Name [alphabetically shows names with A, then B, …]. Since I have the rows getting highlighted with values of Update Date, I would like to sort the table with this column, 'Update Date' so that every time the table gets refreshed, the most recent data [based on Update date] shows up first, then next most recent, etc. Also then the users don't have to scroll up and down to see which rows got highlighted with green, they show up on the top.
Do you have any suggestion how to do [default set up for sorting the table based on a preferred column] that? Many thanks.
- Anonymous5 years agoNot applicable
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!