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
ajohnso2
Advocate I
Advocate I

Dealing with Slicers and Default selections

Hi,

I have a date slicer as below which has a hierarchy.

- Year

--- Period

------ Week

--------- Date/Day

The report should open to a user defaulted to yesterdays date, to achieve this I created a measure to rename yesterday's date to 'Yesterday'... it works great... until Yesterday falls into a new week. The report will yeild <Blank> on all visuals as the the default date wont select in the new week.

Has anyone overcome this issue?

ajohnso2_0-1705510674170.png

 

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ajohnso2 , There is a custom visual "Preselected Slicer", Try that out

 

You can use a measure to select date

amitchandak_0-1705511482667.png

 

View solution in original post

2 REPLIES 2
v-heq-msft
Community Support
Community Support

Hi @ajohnso2 ,
Based on your description, you can try the following steps to troubleshoot your problem:
1.Ensure that the DAX measure you've created for "Yesterday" is dynamic and recalculates daily. The measure should look something like this:

Yesterday = 
CALCULATE (
    MAX ( 'DateTable'[Date] ),
    'DateTable'[Date] = TODAY() - 1
)

 2.Instead of renaming yesterday's date, you can use the relative date slicer feature in Power BI to automatically filter dates relatively to the current date. Here's how to set it up:

vheqmsft_0-1705569054978.png

 

Best regards

Albert He

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
 

amitchandak
Super User
Super User

@ajohnso2 , There is a custom visual "Preselected Slicer", Try that out

 

You can use a measure to select date

amitchandak_0-1705511482667.png

 

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.