cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Carola13 Frequent Visitor
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.

7 REPLIES 7
adityakommu Member
Member

Re: The newest date as default value in slicer

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

 

Thanks

Carola13 Frequent Visitor
Frequent Visitor

Re: The newest date as default value in slicer

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? Smiley Happy

Highlighted
adityakommu Member
Member

Re: The newest date as default value in slicer

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..

 

 

Carola13 Frequent Visitor
Frequent Visitor

Re: The newest date as default value in slicer

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. 

adityakommu Member
Member

Re: The newest date as default value in slicer

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.

 

Community Support Team
Community Support Team

Re: The newest date as default value in slicer

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.
mustafaasiroglu Frequent Visitor
Frequent Visitor

Re: The newest date as default value in slicer

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