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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.