Forum Discussion
Filter with measure as default value
Hello all
I have a report with several filters. One of the filters is for a specific date. For example the data-source contains the dates 5.10.2018, 6.10.2018, 7.10.2018, 8.10.2018
The user has to select the latest date, in this case 8.10.2018. Its always yesterday.
I created a measure to get this date.
But i cant find out how i can set this value as a default value for the filter. I tried the «Smart Filter by OKViz» and the original filter by Power BI.
Is this possible, or do anyone has another idea that would get me the expected result?
The date slicer shows the value unselected, but selecting it after selecting the flag slicer doesn't add any filter to your report (it is already filtered!)
I understand it would look neater if the date was selected, but it is not something you can achieve I am afraid.
9 Replies
- ArentirResolver III
Hi Anonymous
It won't work as a measure, you should have a new column in your date table to identify latest date ("Y" / "N" for instance). Then you can use that as a filte.
A good article on the subject:
https://www.fourmoo.com/2018/09/11/power-bi-default-slicer-selection/
- AnonymousNot applicable
Correct me if im wrong, but as far as i understand this, it will always be the specified value. In my case, this should just work as a default value, it has to be still possible to select another date.
Forgot to say this in my post.
EDIT:
I read your post again and i misunderstood it, but its still impossible this way. I cant change the data-source.
I made a column over power bi with the "yesterday" value.
- ArentirResolver III
I don't think there is a way to just default, hence why I would use a "Latest Date" Flag, for instance in a slicer. You can click/unclick this slicer to see all dates.
You don't need to change the datasource, you can create a calculated column
- v-danhe-msftMicrosoft Employee
Hi Anonymous,
Based on my research, the measure could not be used in the slicer, you could refer to Arentir's solution to solve your problem.
Regards,
Daniel He
- AnonymousNot applicable
What though if we're using a live connection and can't create additional columns?