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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
MRUry7
Resolver II
Resolver II

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 @MRUry7 ,

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
MRUry7
Resolver II
Resolver II

Thanks. I forgot all about that.

v-junyant-msft
Community Support
Community Support

Hi @MRUry7 ,

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.