Forum Discussion
Date Relationship
- 8 years ago
I think since you are creating relationship of disdate and date table using date column that's why you are limiting the capabilities of date data. Therefore if you need to have all the capabilities for date values (hierarchy) then you should create a DateKey (Integer Value) on both tables and then join it on that. After that you will see all the hierarchy for your date values.
Looks like disdate is not a Date Column.
- Click on field.
- Click on Modelling tab
- See if data type is Date , change it to date if it is not.
.
Thanks
- ConorHG8 years agoHelper I
- FarhanAhmed19848 years agoResolver III
Try this.
No Bed Days = DateDiff(FIRSTDATE('Hipe Data'[AdmDate]),FIRSTDATE('Hipe Data'[DisDate]),DAY)
DateDiff takes Scalar as Input, so you need to have 1 value return for each input.
You may use MAX() or MIN() as well instead of FIRSTDATE- ConorHG8 years agoHelper I
Thanks FarhanAhmed1984, that does work for the calc but it also works if I just remove the '.[date]' from 'disdate'.
The problem I'm having seems to be more with the disdate column, without a relationship it works as a date column including date hierarchy.
But when I use it in a relationship with a calendar table I have created I can no longer use it as a date hierarchy and it no longer works in the calc it previously worked in.
Thanks,
Conor.