Forum Discussion
Unable to Execute Dax - Circular Dependency
Hello,
In the last month, I started to get an error message when opening the desktop app:
In doing a bit of research on these forums, it appears it could be linked to a recent release. I have not been able to resolve the issue with workarounds. My Master Calendar query is:
Master Calendar = ADDCOLUMNS( CALENDARAUTO(),
"Year", YEAR([Date]),
"MonthNo", MONTH([Date]),
"Month", FORMAT([Date],"mmm"))
Any ideas?
Thank you both, I was able to go in and update my query as:
Master Calendar = ADDCOLUMNS(CALENDAR(DATE(2019,01,01),DATE(2025,12,31)),"Year", YEAR([Date]),"MonthNo", MONTH([Date]),"Month", FORMAT([Date],"mmm"),"Day", DAY([Date]))
This workaround appears to be working for now, with some modifications to the formatting on existing reports. I may go back in and create a calendar table on PQ as Ritaf1983 suggested in the future, but right now I am under deadline. Thank you!
4 Replies
- Ritaf1983Super User
Hi dghubbard06
This is a known issue with the latest version of Desktop, which is already being addressed.In the meantime, simply change the way you build the calendar table. Instead of using CALENDARAUTO, use the CALENDAR function.
Alternatively, you can build the calendar table in Power Query (PQ) instead of using DAX.
In any case, regardless of this issue, a calendar table built in Power Query will generally be more stable, as it's equivalent to bringing it directly from the data source.
Guide to calnder with dax :
https://blog.coupler.io/power-bi-date-table/#:~:text=Power%20BI%20date%20table%20using%20CALENDAR%20DAX%20functionsWith PQ :
https://radacad.com/create-a-date-dimension-in-power-bi-in-4-steps-step-1-calendar-columnsthe script is included
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
- danextianSuper User
Hi dghubbard06
There's a known bug with CALENDARAUTO causing circular dependency. Use CALENDAR instead specifying the min and start dates. You can reference to the min and start to you fact dates.
Example
CALENDAR ( MIN ( 'fact table'[transaction date] ), MAX ( 'fact table'[transaction date] ) ) - dghubbard06New Member
Thank you both, I was able to go in and update my query as:
Master Calendar = ADDCOLUMNS(CALENDAR(DATE(2019,01,01),DATE(2025,12,31)),"Year", YEAR([Date]),"MonthNo", MONTH([Date]),"Month", FORMAT([Date],"mmm"),"Day", DAY([Date]))
This workaround appears to be working for now, with some modifications to the formatting on existing reports. I may go back in and create a calendar table on PQ as Ritaf1983 suggested in the future, but right now I am under deadline. Thank you! - AnonymousNot applicable
Hi dghubbard06 ,
If your problem is solved, please mark the corresponding answer as a solution.
Best Regards