Forum Discussion
Filtering Visuals by Date
Hi everyone,
I was hoping to get some help on filtering visuals by date in Power BI Desktop.
I am creating a dashboard with HR data, and one of the pages is looking at attrition rates. To do this, I have created the 4 measures below as described in this blog post:
I have an employee fact table & a dimensional date table, joined using inactive relationships between DateTable[Date] and both Employee[LastHireDate] and Employee[LastTerminationDate], as advised in the blog post (see below):
I need to plot a few graphs, an example of one being a line chart showing count of terminated employees over time. Doing so results in the following blank graph:
Similarly, when trying to plot hires by gender in a stacked column chart, it results in a blank graph:
I have tried doing this turning on Employee[LastHireDate] > DateTable[Date] as an active relationship with Employee[LastTerminationDate] > DateTable[Date] as inactive and vice versa, and neither combination seems to work.
I have also tried deleting the inactive Employee[LastHireDate] > DateTable[Date] and Employee[LastTerminationDate]>DateTable[Date] relationships, and created an active relationship between Employee[Date of Birth] and DateTable[Date]. Plotting a bar chart of COUNT(Employee[EmployeeID]) against DateTable[Year] now generates a populated graph.
Would anyone have any idea why this is happening and how I could make the visuals work, ideally using relationships between Employee[LastHireDate]/Employee[LastTerminationDate] and DateTable[Date]?
Many thanks!
6 Replies
- DA1981Frequent Visitor
Is there a problem with your date in your fact table? Is it joining correctly to you date table?
- Ashish_MathurSuper User
Hi,
Such problems can be solved only by working on the PBI file.
- megane123Frequent Visitor
Hi Ashish,
Is there any way I can share a pbix file that contains confidential company information?
Many thanks,
Megan
- Ashish_MathurSuper User
Hi,
Anonymise the data and share the download link here.