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 : I tried to simplify the first query, prevDayFilter as
= Date.AddDays(Date.From(DateTime.LocalNow()), -1)
so that it's a date like 9/3/2020, but I get issue with the measure now:
"The expession return multiple columns. Multiple coulumns can not be converted to a scala r value."
This was an attempt, but didn't work! 😞
Did you add prevDayFilter as a 1 row table?
/ J
- Anonymous6 years agoNot applicable
Hi tex628: I created 'prevDayFilter' as a blank query in Power Query, then renamed it. I created the measure on the 'maintenance summary table' data source and use the prevDayFilter query! The measure is supposed to check ' updateDate' on each row in the 'maintenance summary table' to decide whether to highlight the row, etc. Not sure what to do! 😞
- tex6286 years ago
Community Champion
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- Anonymous6 years agoNot applicable
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 🙂