Forum Discussion
Circular Dependancy when creating Relationship
- 4 years ago
To demo...
exactly the same model...
How is your date table built? Suspect you may be using CALENDARAUTO?
- Termenoque4 years agoFrequent Visitor
Hi Ben, yes I am using CalendarAuto as I have several tables with dates that I need to use and didn't know how to get to a min and max date across various tables. I thought CalendarAuto might be causing this issue but not sure how to correct. Any ideas? Thanks
- bcdobbs4 years agoCommunity Champion
It's worth trying the folowing. When you create the relationship drag from the fact table (many side) into the date table. I think you'll find it works! I know I've had that issue before but now trying in latest version of Power BI I can't recreate the problem at all and it works both ways round.
However I tend to avoid using CALENDARAUTO and go for this sort of approach...
Date = VAR EarliestYear = YEAR ( MIN ( Purchases[Date] ) ) VAR LatestYear = YEAR ( MAX ( Purchases[Date] ) ) RETURN ADDCOLUMNS ( CALENDAR ( DATE ( EarliestYear, 1, 1 ), DATE ( LatestYear, 12, 31 ) ), "Month Year", DATE ( YEAR ( [Date] ), MONTH ( [Date] ), 1 ) //Format as mmm YYYY )- bcdobbs4 years agoCommunity Champion
To demo...
exactly the same model...