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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Bhoobala_P
Frequent Visitor

Make Time slicer to appear with specific date range selected, for a published Power BI dashboard

I had created a dashboard with time slicer. My date ranges, say from 2011 to till date of 2016. I had published the dashboard into power bi. Let us assume that the date selected in the time slicer is 01/01/2016 and 15/12/2016. The data gets populated through live connection.

 

Hence when someone runs the dashboard on 17/12/2016, data till 16/12/2016 will be available to view. but the selected date will point to 01/01/2016 to 15/12/2016, instead of 01/01/2016 to 16/12/2016. In other words, the user has to manually adjust the date to set it to current year's date range till date.

 

My problem is that I want to automatically update the time slicer selected date. For instance, assume that data is available till 17/01/2017. Hence the current year is 2017 and the selected date should be from 01/01/2017 to 17/01/2017 in the time slicer for the user to view. Please note that data from other dates (2016) will also be available but the selection date of the slicer should point to starting date of the current year to current date of the current year.  Time Slicer Selected DateTime Slicer Selected Date

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

Hi @Bhoobala_P,

In your scenario, create a calendar table and create relationship between calendar table and your original table.

Then create a new column using the following formula in the calendar table, create a slicer using the new column and select 1 as default value in the slicer. For more deatils, please review the example in this attached PBIX file.

Column = IF('Date'[Year]=YEAR(NOW())&& 'Date'[DateKey]<=TODAY()-1,1,0)
1.PNG

 

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yuezhe-msft
Employee
Employee

Hi @Bhoobala_P,

In your scenario, create a calendar table and create relationship between calendar table and your original table.

Then create a new column using the following formula in the calendar table, create a slicer using the new column and select 1 as default value in the slicer. For more deatils, please review the example in this attached PBIX file.

Column = IF('Date'[Year]=YEAR(NOW())&& 'Date'[DateKey]<=TODAY()-1,1,0)
1.PNG

 

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
BhaveshPatel
Community Champion
Community Champion

In that case,You should only use Year Column as a slicer instead of Dates. This should give you the results of the currrent year with current dates.

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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