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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Andrewstg
Regular Visitor

Using time slicer for 2 dates

So I have a time slice going off of registration end date, it gets all of the enrolled, dropped, graduated students for this date. The problem is there are students who also start in this time frame that I want to list as new starts. I am new to power bit but other programming languages I would write an if statement or something along those lines. The problem is the slicer does quarters, years, months I am really unsure of how to approach this.

Here is a link to the layout https://imgur.com/a/JeBjx

 

How I have enrolled etc I would like to add new starts that fall within this date, even if i do it how i do hours and total students.

Here is an example, the timeslicer uses reg end date.

                     Name         Student ID      StartDate                 EndDate
                   Billy  Bob          3252          1-11-2014               3-5-2016
                   Jay   Wright       4363          2-23-2016              7-15-2019
                   Donny   Dob      2525          1-1-2015                4-3-2017
                   Ringer Rod        4674           1-2-2013               4-2-2015

 

 

1 ACCEPTED SOLUTION
MattAllington
Community Champion
Community Champion

When you have 2 date columns, the complexity goes up. One option is to have 2 slicers, one for start date and the other for end date (just use a drop down list for both). You need to write a dax measure to manage the filtering on both columns. Something like this would work. 

 

Total hours = calculate([total hours],filter(table, table[start date] >=selectedvalue(table[start date]) && table[end date] <=selectedvalue(table[end date])))

 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

1 REPLY 1
MattAllington
Community Champion
Community Champion

When you have 2 date columns, the complexity goes up. One option is to have 2 slicers, one for start date and the other for end date (just use a drop down list for both). You need to write a dax measure to manage the filtering on both columns. Something like this would work. 

 

Total hours = calculate([total hours],filter(table, table[start date] >=selectedvalue(table[start date]) && table[end date] <=selectedvalue(table[end date])))

 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
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.