cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KamilSzpyrka
Helper II
Helper II

Create a table using CROSSJOIN and then create relationship (circular dependency)

Hello,

I need to create a fact table in my model based on 2 dimension tables. I used CROSSJOIN function and create table as below.

KamilSzpyrka_0-1653564866864.png

 

The problem is I cannot link it to the source dimension tables now, because it creates circular dependency error. Is there any solution for this?

KamilSzpyrka_1-1653564933342.png

 

Thanks, Kamil

 

1 ACCEPTED SOLUTION

@KamilSzpyrka,

 

Try using DISTINCT instead of VALUES. Also, make sure dDate is marked as a date table.

 

https://www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/ 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
v-kalyj-msft
Community Support
Community Support

Hi @KamilSzpyrka ,

Has your problem been solved by @DataInsights's solution? 

If so, Would you mind accept his reply as solution? Then we are able to close the thread. More people who have the same requirement will find the solution quickly and benefit here. Thank you.

Best Regards,
Community Support Team _ kalyj

Thank you for the reminder. Mentioned solution works indeed. Topic can be closed. 

DataInsights
Super User
Super User

@KamilSzpyrka,

 

Try creating the cross join in Power Query:

 

https://docs.microsoft.com/en-us/power-query/cross-join 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




I can't do this, since one of the tables is calculated table created in DAX.

@KamilSzpyrka,

 

Try using DISTINCT instead of VALUES. Also, make sure dDate is marked as a date table.

 

https://www.sqlbi.com/articles/avoiding-circular-dependency-errors-in-dax/ 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




It works indeed, thank you for your help.

Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Show episode 9

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 25

Ted's Dev Camp - August 25, 2022

Watch Session 25 of Ted's Dev Camp.

Top Solution Authors