Forum Discussion
How to do date relationship with fact table
- Anonymous2 years ago
Hi ashmitp869 ,
Thanks DataNinja777 for the quick reply. I have some other thoughts to add:
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a measure.
Employee Hrs Measure = var _min=CALCULATE(MIN('Pay Period'[Date From]),ALLSELECTED('Pay Period')) var _max=CALCULATE(MAX('Pay Period'[Date To]),ALLSELECTED('Pay Period')) RETURN CALCULATE(SUM('MpSummaryHours'[Employee Hrs]),FILTER(ALL('MpSummaryHours'),[Pay Period End Date]<=_max && [Pay Period End Date] >= _min))(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi ashmitp869 ,
Thanks DataNinja777 for the quick reply. I have some other thoughts to add:
According to your description, here are my steps you can follow as a solution.
(1) This is my test data.
(2) We can create a measure.
Employee Hrs Measure =
var _min=CALCULATE(MIN('Pay Period'[Date From]),ALLSELECTED('Pay Period'))
var _max=CALCULATE(MAX('Pay Period'[Date To]),ALLSELECTED('Pay Period'))
RETURN CALCULATE(SUM('MpSummaryHours'[Employee Hrs]),FILTER(ALL('MpSummaryHours'),[Pay Period End Date]<=_max && [Pay Period End Date] >= _min))
(3) Then the result is as follows.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.