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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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