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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
LotteLaugesen
Helper V
Helper V

How to get selected date from slicer

Hi 

 

How can I get the selected date from a date slicer?
I have tried this:
Test MaxDate = SELECTEDVALUE(Dim_Calendar[Date]) (Returns blank)
Test MaxDate = MAX
(Dim_Calendar[Date])

Test MaxDate = CALCULATE(MAX(Dim_Calendar[Date]),ALLSELECTED(Dim_Calendar[Date]))
 
The 2 last returns the last date in Dim_Calendar (31/12/2029) and not the selected date.
LotteLaugesen_0-1658129092489.png
Can anybody help?

BR

Lotte

1 ACCEPTED SOLUTION

9 REPLIES 9
vapid128
Solution Specialist
Solution Specialist

That is not normal.

I use MaxDate = MAX(Dim_Calendar[Date]) a lot.

 

The only case i can think how this happen is:

 

you have 2 tables with date. One end at 2029 and the other one end at 2022.

When your filter at the last of the one end with 2022.

It doesn't main you have a filter at a day in 2022.

It means you have no filter.

 

Or check you relationship, the cross filter direction need to be both.

v-rongtiep-msft
Community Support
Community Support

Hi @LotteLaugesen ,

Have you solved the issue now? If so, please mark the solution as the answer. If not, please provide more details with your desired output and pbix file without privacy information.

 

Best Regards
Community Support Team _ Polly

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

 

SpartaBI
Community Champion
Community Champion

@LotteLaugesen how did you configure the slicer? Dates greater then?

What do you get when you write:

Test MinDate = MIN(Dim_Calendar[Date])

?

@SpartaBI 
The slicer is Dates before 
When I change it to Test MinDate = MIN(Dim_Calendar[Date]) I get 1/1/1900

 

 

Can you share the file (leave just the relevant columna with dates)

?

Thank you for asking - because now I found the problem. 😉

The calendar was related to another table with relationship both

 

 

@LotteLaugesen great, will appreciate your kudos 😉

@SpartaBI yes I will, but I found out it wasn't the whole truth.
I removed the relation a test solution and it worked, but when I did it the real solution it went back to 31/12/2029 😣

@LotteLaugesen will pm you now

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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