Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi experts, I want to create a slicer always select max value of a certain column, is there any solution?
Solved! Go to Solution.
Yes but not in the way you are expect. When you put a slicer onto a page, its going to remember the literal selection. So what we want to do is create a new column, that replicates the old slicer column as text, but replaces the "max" with an unchanging phrase that you can select as default.
For example, lets pretend your slicer column is a date column and the maxium value is going to be todays date. Your new column will be of type "Text" and you will need to write some code that says something along the lines of
If [Date] = <Todays Date> then "Today" else Text.From([Date], "dd-MMM-yyyy")
Now when you put this new column in your slicer, you will select "Today" which it will remember. Today, as a value, will be updated every time you refresh your model.
Yes but not in the way you are expect. When you put a slicer onto a page, its going to remember the literal selection. So what we want to do is create a new column, that replicates the old slicer column as text, but replaces the "max" with an unchanging phrase that you can select as default.
For example, lets pretend your slicer column is a date column and the maxium value is going to be todays date. Your new column will be of type "Text" and you will need to write some code that says something along the lines of
If [Date] = <Todays Date> then "Today" else Text.From([Date], "dd-MMM-yyyy")
Now when you put this new column in your slicer, you will select "Today" which it will remember. Today, as a value, will be updated every time you refresh your model.