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
HoustonLamb
Frequent Visitor

single slicer for multiple dates in one table

I have been stalled by an issue involving multiple dates within one table. The request is to get counts of product packages where all 3 dates fall in the date range (slicer). They also want it broken down by "New" and "Renewal" packages. The dates are a Submit Date, Approval Date, and Book Date. So if all 3 of the dates fall into the date slicer range, then count the package. Any ideas?

3 REPLIES 3
Anonymous
Not applicable

Hi @HoustonLamb ,

 

Thanks for the reply from Ritaf1983 .

 

A calculated column can be created to validate that the date is in range.

DateRangeIsValid = 
VAR StartDate = MIN('Date'[Date])
VAR EndDate = MAX('Date'[Date])
RETURN
IF(
    'Table'[Submit Date] >= StartDate 
    && 'Table'[Submit Date] <= EndDate 
    && 'Table'[Approval Date] >= StartDate 
    && 'Table'[Approval Date] <= EndDate 
    && 'Table'[Book Date] >= StartDate 
    && 'Table'[Book Date] <= EndDate,
    1,
    0
)

 

Then create a measure to calculate the value 1, which is the number of rows with dates in the range:

Count = CALCULATE(COUNTROWS('Table'),'Table'[DateRangeIsValid] = 1)

vhuijieymsft_0-1715585807292.png

 

You mentioned “They also want it broken down by ‘New’ and ‘Renewal’ packages”.

 

What is the basis of their categorization? If you can tell me how they categorize it I will be able to better solve your problem.

 

You are welcome to contact me anytime.

 

pbix file is attached.

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Thank Yang. That's close, but not quite what i'm trying to accomplish. i want to count them if the fall in a date range slicer. The slicer is adjustable, so say i adjust the slicer to 3/1 - 3/31, all of those should get a 0 for the count since the dates fall outside of that date range. i have added 2 additional rows to the data so you can see that if i were to select 2/1 - 4/1 that they would get a 1 for the count, but if i did 3/1 - 4/1 they should not, because the submit date falls outside of the range.date snip.PNG

Ritaf1983
Super User
Super User

Hi @HoustonLamb 
It sounds like a classic scenario for "role-play dimensions".
Please refer to the linked guides :

https://www.youtube.com/watch?v=2BxaUXlx3K4&t=10s

 

https://www.youtube.com/watch?v=-ViFYglNkDQ

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

 

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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.