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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Anonymous
Not applicable

USERELATIONSHIP with Date slicer

Hi,

 

I'm having trouble with my date slicer to coincide with the measures I have in a clustered column chart.

 

Goal - I want to see on the clustered column chart, 2 measures: people who start, 'Starters', and people who left the company, 'Leavers'. These are on the Y axis. The area of the company they left is on the X axis.

 

Measures being used:

 

Starters =
var startermeasure = calculate(DISTINCTCOUNT('All Postholding w/ Projected End Date History'[Employee Number]), 'All Postholding w/ Projected End Date History'[starter] = 1)
var starterempstartdate = CALCULATE(startermeasure, USERELATIONSHIP('Date'[Date],'All Postholding w/ Projected End Date History'[Emp Start Date]))

return starterempstartdate
 
Leavers =
var leavermeasure = calculate(DISTINCTCOUNT('All Postholding w/ Projected End Date History'[Employee Number]), 'All Postholding w/ Projected End Date History'[leaver] = 1)
var leaverempenddate = CALCULATE(leavermeasure, USERELATIONSHIP('Date'[Date],'All Postholding w/ Projected End Date History'[ph end Date]))

return leaverempenddate
 
Here is the data model, 'Date'[Date] column with active relationship to 'All Postholding w/ Projected End Date History'[Original Start Date] and inactive relationships for measures above to work:

 

dannyHE_0-1652881919530.png

 

The measures seem to work, but the issue is when I put a date slicer on the page; as it's still using whichever relationship is active, it's filtering the visuals to the incorrect numbers; e.g: if the 'Dates'[Date] to 'All Postholding w/ Projected End Date History'[ph end Date] is active, the leavers number is correct but the starters is wrong and I get the following:

 

dannyHE_5-1652883031037.png

S= Starters, L = Leavers

dannyHE_6-1652883162157.png

Drill-through to a 'Leavers - Data' page where the 'Leavers' measure goes to and has table above

 

 

But then if Date'[Date] to 'All Postholding w/ Projected End Date History'[Emp Start Date] relationship is active I get the following:

 

dannyHE_4-1652882942257.png

 

dannyHE_3-1652882881490.png

Drill-through to a 'Starters - Data' page where the 'Starters' measure goes to and has table above.

 

 

How do I get the date slicer to just let me pick between two dates, and I get the correct number of starters or leavers on the column chart, and when I right-click drill-through, the relevant measure I'm drilling through with takes me to the appropriate page with the right data?

 

Thanks in advance, I hope all the information is clear enough!

 

 

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Refer my blog on the same topic

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

 

Attached file after signature if needed

 

Share with Power BI Enthusiasts: 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

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Refer my blog on the same topic

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

 

Attached file after signature if needed

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

thanks @amitchandak 

 

I don't think I wrote the DAX in the measures to be optimal, but your article got me to a working solution 👍

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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