简体   繁体   中英

Default slicer selection (latest date) in Power BI

My requirement is when a report will be opened in Power BI services by default, the latest date will be selected in a single select slicer.

Consider in import mode there are 10 dates are coming and assigned to a slicer (single select dropdown). By default it shows the older date as the selected date.

I need to do the opposite. It should be the latest date selected by default and if the user wants to select other dates they can change manually. My landing page by default should show the latest date dynamically.

It's not possible to select the latest date in slicer automatically. However, there is a kind of workaround for this which I have explained below.

Just create an additional column using original date like this:

Date 2 = IF('Table'[Date] = TODAY(), "Today", FORMAT('Table'[Date], "MM-DD-YYYY"))

Then use this newly created column in your slicer and manually select 'Today' in that slicer once and publish the file to the Power BI service. So the end user will always see 'Today' selected in a slicer by default which obviously represents the current date.

在此处输入图像描述

Note: if you want latest date to be selected which is not necessarily current date then you can create the column below :

Date 2 = IF('Table'[Date] = MAX('Table'[Date]), "Latest Date", FORMAT('Table'[Date], "MM-DD-YYYY"))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM