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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
sraj
Responsive Resident
Responsive Resident

Slicer with Period Start & Period End Date

Hi Everyone,

 

Can someone please tell me if this is possible with any measure?  I have these two fields Payment Period Start Date & Payment Period End Date, would like to know if I can have one slicer for these so I can give the users the Between or Date range option?

 

Thank you!!

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@sraj , you can connect both of them with a date table. One will active and one inactive. You can join them using use relation.

 

see how to use userelation : https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

Icey
Community Support
Community Support

Hi @sraj ,

 

How about this?

 

1. Create a seperate Dates table.

Dates = CALENDAR(DATE(2020,1,1),DATE(2020,4,30))

 

2. Create a measure.

Measure =
VAR MaxDate =
    MAX ( Dates[Date] )
VAR MinDate =
    MIN ( Dates[Date] )
RETURN
    IF (
        MAX ( 'Table'[Payment Period Start Date] ) >= MinDate
            && MAX ( 'Table'[Payment Period End Date] ) <= MaxDate,
        1
    )

 

3. Put the Measure into "Filters on this visual" of the visuals needed and set as 1.

measure.PNG

 

4. Test.

filter date.gif

 

BTW, .pbix file attached.

 

 

Best Regards,

Icey

 

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

3 REPLIES 3
Icey
Community Support
Community Support

Hi @sraj ,

 

How about this?

 

1. Create a seperate Dates table.

Dates = CALENDAR(DATE(2020,1,1),DATE(2020,4,30))

 

2. Create a measure.

Measure =
VAR MaxDate =
    MAX ( Dates[Date] )
VAR MinDate =
    MIN ( Dates[Date] )
RETURN
    IF (
        MAX ( 'Table'[Payment Period Start Date] ) >= MinDate
            && MAX ( 'Table'[Payment Period End Date] ) <= MaxDate,
        1
    )

 

3. Put the Measure into "Filters on this visual" of the visuals needed and set as 1.

measure.PNG

 

4. Test.

filter date.gif

 

BTW, .pbix file attached.

 

 

Best Regards,

Icey

 

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

Tahreem24
Super User
Super User

Try with the UNION function.

Table = UNION( DISTINCT(Table[StartDateColumn]), DISTINCT(Table[EndDateColumn]) )

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
amitchandak
Super User
Super User

@sraj , you can connect both of them with a date table. One will active and one inactive. You can join them using use relation.

 

see how to use userelation : https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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