Forum Discussion
Filter data with a measure containing a date
- 5 years ago
Anonymous So it seems like you want something that I call a Complex Selector. https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Complex-Selector/m-p/1116633#M534
In your case it would be something like:
Selector Measure = VAR __CurrentDate = MAX('Table'[published (date)]) VAR __Table = FILTER('Table',ALLEXCEPT('Table','Table'[id])) VAR __MaxDate = MAXX(__Table,[published (date)]) RETURN IF(__CurrentDate = __MaxDate,1,0)You can then use this measure in the filter pane and filter for 1. __CurrentDate gets the current row's date and compares with the maximum date for that id. If they match, returns 1 otherwise 0. You could also do this as a column.
Anonymous So it seems like you want something that I call a Complex Selector. https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Complex-Selector/m-p/1116633#M534
In your case it would be something like:
Selector Measure =
VAR __CurrentDate = MAX('Table'[published (date)])
VAR __Table = FILTER('Table',ALLEXCEPT('Table','Table'[id]))
VAR __MaxDate = MAXX(__Table,[published (date)])
RETURN
IF(__CurrentDate = __MaxDate,1,0)
You can then use this measure in the filter pane and filter for 1. __CurrentDate gets the current row's date and compares with the maximum date for that id. If they match, returns 1 otherwise 0. You could also do this as a column.
- Anonymous5 years agoNot applicable
Greg_Deckler just a quick question I forgot to ask, why make a temporary table filtered containing only the id's ? I may think it's for efficiency but I want to be sure,
Thanks in advance,
- Greg_Deckler5 years ago
Community Champion
Anonymous It doesn't actually have just id column in the temp table, it is only considering the id column when filtering the table.