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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
hpatel247
Helper I
Helper I

Create measure based on slicer date

Hi,

 

Not sure if it is possible but i want to display data based on a date selected by end user which can change. My data consists of service users with different services which are open and closed. So for example if i had a service user with home care with the start date of 10/04/2014 and end date of 26/07/2017, if the end user selects 20/06/2017 - this service user will be displayed but if they select 12/08/2017, this service user will not be displayed.

 

 

Service User Name            Service Type      Start Date            End Date

J Bloggs                              Home Care       01/04/2017       14/04/2017

J Bloggs                              Day Care          28/06/2017        29/06/2017

J Bloggs                             Residential Care   01/04/2015      20/08/2017

 

 

Another example as above, based on the date selected above i would only expect to see Day Care and Residential care for the first date and then just residential care for the second date

 

Is this possbile in any way?

 

regards

 

Hetal

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

Hi hpatel247,

 

Based on your description, you have create a calendar table and set a slicer on the date column of calendar table, then use the slicer to filter another table, right?

 

You can use DAX formula like this:

result = CALCULATE(MAX(Table1[Service Type]), FILTER(Table1, Table1[Start Date] <= SELECTEDVALUE('calendar table'[Date]) && Table1[End Date] >= SELECTEDVALUE('calendar table'[Date])))

Result is like below:

1.PNG 

 

PBIX here: https://www.dropbox.com/s/xensfubqmjp4fu9/Create%20measure%20based%20on%20slicer%20date.pbix?dl=0

 

Regards,

Jimmy Tao

 

 

Hi Jimmy,

 

Thank you for your response. I have tested this but still doesn't show what i need it to show. Based on your formula, if the date was set as 20/08/2017, the result will be displayed however if you select 19/08/2017, i would still expect the result to be displayed but it doesn't.

 

I am working with start and end dates and whichever date is selected, it needs to show all services that were still open as at that date if this makes sense.

 

Very grateful for your assistance with this.

 

kind regards

Hetal

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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