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
Serdet
Post Patron
Post Patron

Slicer Hire Duration

Hi All,

 

I have a dataset similar to the below. 

 

I want to create a slicer which when individual buttons are selected will show ID's that have been on hire for 1 month, 2 months, 3months etc. 

IDOn Hire DateOff Hire Date
101/01/201901/02/2019
201/01/201901/03/2019
301/01/201901/04/2019
401/01/201901/05/2019

 

Can anyone please help?

 

6 REPLIES 6
v-jayw-msft
Community Support
Community Support

Hi @Serdet ,

 

Create a table as below and use the month column as silcer.

1.PNG

Then create a measure as below and add it to visual filter.

Measure = IF(DATEDIFF(SELECTEDVALUE('Table'[On Hire Date]),SELECTEDVALUE('Table'[Off Hire Date]),MONTH)<=SELECTEDVALUE('month'[value]),1,0)

Result would be shown as below.

2.PNG

3.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Hi Jay,

 

Thanks for your comment. I have followed the advised steps and have the below outcome.

 

  • When a month is selected the visual I am hoping to effect will lose all of its changed settings (i.e font etc) and it will not show any results.

Please can you advise?

Hi @Serdet ,

 

I don't get the point, could you explain the details?

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
Fowmy
Super User
Super User

@Serdet 

Can you provide more information and explain further? 
What do you need to select/filter? is it Period as months?, How does Off Dates come in to play?
Show an expected output as well to better understand your requirement.

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

I accept KUDOS 🙂

YouTube, LinkedIn

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Hi,

I am looking at scaffold data and have an On Hire and Off Hire date. From this, I want to create a slicer which will show certain clickable boxes (i.e 1 month, 2 months, 3 months) and when these boxes are selected it will show me all scaffolds that have been on hire longer than the selected time frame.

 

Sorry for the jaba jaba.

amitchandak
Super User
Super User

@Serdet , refer if this can help

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

 

or a slicer like this

https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/50...

 

and formula like

Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date],ENDOFMONTH(Sales[Sales Date]),-3,MONTH))
Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date ],MAX(Sales[Sales Date]),-3,MONTH))

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.