Forum Discussion
Slow moving Dimension
I already found multiple topics around slow moving dimensions but they do not solve my challange.
A simple example:
Dimension table with surragateKey:
Fact table:
Date table (disconnected):
The requirement is that we want to see a report with the value against the status at the point in time.
I found some topics that advised to create measures so I have created the following measures:
Amount:
The problem now is it doesn't work when I want to create a slicer on the status as I can't use a measure value in the slicer and using the status from the dimension won't give the same results.
And it also doesn't work when I want to create a matrix with the status in the row header as the measure can't be added there.
What would be best practise when working with Slow moving dimensions and wanting to use the values from the dimensions in slicers and the value should be based on the dimension value at a moment in time (as of date).?
SnoekL , In this case date dim, should not have any join with table, if there is a join you need to remove
refer current employee logic, check crossjoin
Current Employees = CALCULATE(COUNTx(FILTER(Employee,Employee[Start Date]<=max('Table'[Date]) && (ISBLANK(Employee[End Date]) || Employee[End Date]>max('Table'[Date]))),(Employee[Employee Id ])),CROSSFILTER(Employee[Start Date],'Table'[Date],None))
For SCD Creation refer Video from Guyinacube - https://www.youtube.com/watch?v=tKeaQpWynzg
For cases like Current employee refer blog or attached files
Power BI: HR Analytics - Employees as on Date : https://youtu.be/e6Y-l_JtCq4
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
Power BI HR Active Employee Tenure Bucketing, and Hired, Terminated, and Active employees: https://youtu.be/fvgcx8QLqZU
1 Reply
- amitchandakSuper User
SnoekL , In this case date dim, should not have any join with table, if there is a join you need to remove
refer current employee logic, check crossjoin
Current Employees = CALCULATE(COUNTx(FILTER(Employee,Employee[Start Date]<=max('Table'[Date]) && (ISBLANK(Employee[End Date]) || Employee[End Date]>max('Table'[Date]))),(Employee[Employee Id ])),CROSSFILTER(Employee[Start Date],'Table'[Date],None))
For SCD Creation refer Video from Guyinacube - https://www.youtube.com/watch?v=tKeaQpWynzg
For cases like Current employee refer blog or attached files
Power BI: HR Analytics - Employees as on Date : https://youtu.be/e6Y-l_JtCq4
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
Power BI HR Active Employee Tenure Bucketing, and Hired, Terminated, and Active employees: https://youtu.be/fvgcx8QLqZU