Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Carola13
Frequent Visitor

The newest date as default value in slicer

Hey,

 

I've got slicer as below. I need to set the newest date in column as default value when someone open the visulization when I'll publish it.

 

Capture1.PNG

 

I've tried several ideas from this forum, but none of them worked fine for me.

 

Thanks for your help.

10 REPLIES 10

Hi Carola,

 

There is a workaround solution to set a slicer value to today or this month.

 

Firstly create a calculated column in date table like:  

 

 

Year with This = IF(YEAR(TODAY())='Sales Date'[Year],"This Year",'Sales Date'[Year])

 

And use this new column in slicer as below image and selecet "This Year" value from slicer manualy at once. It will always change meaning of "this" according to column formula and report will always open with current date!

 

 

 

Screenshot_3.jpg

 

I hope it helps,

 

Mustafa Asiroglu

Thank you so much, you saved my life 😊😊

This looks useful for me, how can you do this for "Today", i tried but get a unexpected error .

 

This --> https://ibb.co/gWQHCVR

Hi remaster,

It seems like your formula consist an if condition yielding different datatypes. Since "Today" is text, you should convert other date values to text as well in desired format. When you do this last step needed is sort by column, you need to sort this new column based on real date column.
I hope this helps.
v-yulgu-msft
Employee
Employee

Hi @Carola13,

 

As of now, it is not supported to specifiy and keep any default slicer selection. To filter data via slicer, users have to manually select any value first.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Can you try max( Date)  in "date" column and keep it selected and get it published.

 

Thanks

I tried

New measure = MAXA(Order Date)

and after that I want to create

New column = New measure

but it shows me something like this: Function 'MAXA' is not allowed as part of calculated column DAX expressions on DirectQuery models. The same happening when it's MAX function. 

Could you write more specific instruction? 🙂

Anonymous
Not applicable

Ok seems like you are using Direct query why dont you write MAx(date) in Sql , and get that particular column.

 

select.. max(date) from .. group by..

 

 

That's true, I'm using Direct Query. Your idea seems good. So when I'll create new column in table using SQL and I guess it will looks like max(date) in every row, then how this will help me with keep selected the newest date in slicer? Sorry, I'm using Power BI since last month, so I don't have big knowledge of this tool. 

Anonymous
Not applicable

First in sql when you write sql query 

 

select MAx(date )  as "Date Selected".. from table 1 group by..

 

So you will get a new column "Date Selected ", you need not write again max in powerbi , because you will always get the max from sql.

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.