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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Anonymous
Not applicable

Unable to get date ranges using firstdate

Hi, I have a manually created table where the user will pick from a drop down

MRUry7_1-1706794956631.png

 

MRUry7_2-1706795292501.png

 

I want it to get the correct starting date, depending on what the user clicks on above
In the example above, when I click All Data, the first date in the table appears.
But when I click on any other option here, the card on the right comes up blank.  Here's the code I'm using

_1 Start Date =
SWITCH (
   SELECTEDVALUE('_CalendarOptions'[Options]),
   "All Data", MIN('SingleMultiPageVisits'[MetricDate]),
   "Last Month", FIRSTDATE(DATESINPERIOD('SingleMultiPageVisits'[MetricDate], TODAY(), -2, MONTH)),
   "This Month", FIRSTDATE(DATESINPERIOD('SingleMultiPageVisits'[MetricDate], TODAY(), -1, MONTH)),
   "Last Year", FIRSTDATE(DATESINPERIOD('SingleMultiPageVisits'[MetricDate], TODAY(), -1, YEAR)),
   "Year Before That", FIRSTDATE(DATESINPERIOD('SingleMultiPageVisits'[MetricDate], TODAY(), -2, YEAR))
)

Needless to say, I have no idea why this isn't working for the rest of the options.
Would appreciate any help?
1 ACCEPTED SOLUTION
v-junyant-msft
Community Support
Community Support

Hi @Anonymous ,

This is a table visual not a slicer:

vjunyantmsft_0-1706836379810.png

When you select the content in the table visual, It will only act as a highlight, without any filtering effect. Please change the table visual into a slicer.

vjunyantmsft_1-1706836520283.png


Best Regards,
Dino Tao
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
Anonymous
Not applicable

Thanks. I forgot all about that.

v-junyant-msft
Community Support
Community Support

Hi @Anonymous ,

This is a table visual not a slicer:

vjunyantmsft_0-1706836379810.png

When you select the content in the table visual, It will only act as a highlight, without any filtering effect. Please change the table visual into a slicer.

vjunyantmsft_1-1706836520283.png


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

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors