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
bwaetford
Frequent Visitor

HR Data - Slowly Changing Dimensions

I am working on an HR report and have a type 2/slowly changing table called employee_data (the table has a "from date" and "to date").  data changes per employee infrequently, but when data changes the employee gets a new row where from date = the date the transaction is entered, and to date = a date in the very distant future. The employees previous row is updated with the 'to date' being the day prior to the new row. I also have a date table with one row per day. 

 

I'd like to create a report that shows the count of employees per month, but dont seem to be able to find a way to create a join from the date dimension to the employee dimension using "between".

 

Any suggestions on how to best achieve a join from a slowly changing dimension to a date dimension such that if the month grain is chosen in a report, that the employee is counted every month for which they have a valid record (based on the from and to dates)?

 

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@bwaetford,

Please check if the DAX in attached PBIX file returns your expected result. If not, please share sample data of your table and post expected result here.



Regards,
Lydia

Community Support Team _ Lydia Zhang
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

4 REPLIES 4
v-yuezhe-msft
Employee
Employee

@bwaetford,

Please check if the DAX in attached PBIX file returns your expected result. If not, please share sample data of your table and post expected result here.



Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @v-yuezhe-msft thank you for this post. 

I tried out this solution and found it works well.

How would you include time in this? as either time by its self or with date...

Great help. Thanks!

@bwaetford,

If my method solves your issue, please accept my reply as solution to close this thread.

Regards,
Lydia

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

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.