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
Ramees_123
Helper IV
Helper IV

How to make the current date

I have year, month, week and day slicer, once the page loading it should show the current date and also it shold be able to filter by the year, month, week and day by manually.Date.PNG

3 REPLIES 3
nandic
Memorable Member
Memorable Member

By default, there are no predefined items in slicer. So once you run the report, it will run either "select all" or items that you selected in slicer.
Alternative is to use function selectedvalue which get value from slicer. And it has second parametar which is "alternate result".
So you can make it something like this:

Countrows test =
var _selectedManager = SELECTEDVALUE(Manager[Manager Name],"Person 2")  -- get selected Manager from slicer, if no manager is selected use Person 2
RETURN
CALCULATE([Countrows],FILTER(Manager,Manager[Manager Name] = _selectedManager))

Also, if you need to show anything by today date, you can use function today() to filter data on today date.

Today function wont filter different field, like year,month,day,week, In every slicer it should select the current value.

In that manager case it will select always one value, not dianamically.

Hi @Ramees_123,

AFAIK, current power bi slicers not excited theatre to pickup a default value or auto-selected items.

I'd like to suggest you use relative mode slicer to auto choose the last date or create a calculated column to compare date with today function to return tag and use it to create a slicer to choose today item to save into a bookmark.

After these steps, you can click on the bookmark to quickly restore the slicer selection of current date.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.