Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jwin2424
Resolver I
Resolver I

Calculating between two tables - circular dependency?

Hello, 

I have three tables as follows:

jwin2424_0-1711133445057.png

 

Table 1 and Table 3 are joined together with a Many to one reltaionship with the many side being on table 3 and the one side beind on table 1. The cross filter direction with this relationship is 'Both.' They are joined together by the OPP ID.

Table 2 is not joined in any way. It is simply a reference table with some % data on it. 

Table 1 is the only table with a stage and a quarter number, so I concated the two together and used it as my primary lookup key. I did a lookup from Table 2 to return to % to win. The value of each OPP ID is on Table 3. I did a lookup with the OPP ID to return the concat value. I used the concat value to lookup from table Table and return the %. 

I have tried this a few ways, and I keep getting a circular dependency error. 

I have tried getting the % to win two different ways. I cant seem to get the % either through the diconnected table nor the connected one. Can anyone help?

jwin2424_1-1711134064071.png



I am trying to get the line items on Table 3 to the value and multiply it by the % to win based on the concat number. 

 

Thanks!

1 ACCEPTED SOLUTION
v-yanimei-msft
Community Support
Community Support

Hi all , 

@QuentinBl , thanks for your concern about this case, I have some additions for problem solving.

@jwin2424 , thank you for giving a specific description of the problem. Based on your description, I may not be able to understand and solve your problem very well. Depending on the content of your text, I will give you the following steps to solve the problem.

1. Create three tables as the picture you show.

The original Table 1.

vyanimeimsft_0-1711348548979.png

The original Table 2.

vyanimeimsft_1-1711348561129.png

The original Table 3.

vyanimeimsft_2-1711348572911.png

In Table1, New column % to win and input:

 

% to win = LOOKUPVALUE(Table2[% to win],Table2[Concat],Table1[Concat])

 

vyanimeimsft_3-1711348585389.png

In Table 3, New column Concat and input:

 

Concat = LOOKUPVALUE(Table1[Concat],Table1[OPP ID],Table3[OPP ID])

 

2. Manage relationships as the text “Table 1 and Table 3 are joined together with a Many to one reltaionship with the many side being on table 3 and the one side beind on table 1. The cross filter direction with this relationship is 'Both.' They are joined together by the OPP ID. Table 2 is not joined in any way. It is simply a reference table with some % data on it.".

vyanimeimsft_4-1711348681290.png

vyanimeimsft_5-1711348688408.png

3. In table 1, New column primary lookup key as the text “Table 1 is the only table with a stage and a quarter number, so I concated the two together and used it as my primary lookup key.” and input:

 

primary lookup key = CONCATENATE(Table1[Stage],Table1[Close Quarter])

 

vyanimeimsft_6-1711348720679.png

4. The operation as the text “I did a lookup from Table 2 to return to % to win. The value of each OPP ID is on Table 3. I did a lookup with the OPP ID to return the concat value. I used the concat value to lookup from table Table and return the %.” has been done in step1.

5. In Table 3, New column % to win value as the text “ I am trying to get the line items on Table 3 to the value and multiply it by the % to win based on the concat number.” and input:

 

% to win value = Table3[Estimated Value]*RELATED(Table1[% to win])

 

vyanimeimsft_7-1711348766515.png

You can modify the above DAX codes according to your needs.

I have no way of analyzing what you are causing the loop error because I don’t know the data what is.

To better solve your problems, you may need to answer some questions.

1. What is the data you have used in the Measure Test as your picture? Please give the data of table Opportunity ,Opportunity Product, Forecast Statistics with pictures.

vyanimeimsft_8-1711348779701.png

2. What is your desired outcome? Please give your specific requirements and an example diagram of what to expect.

 

 

Best Regards,

Caroline Mei

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yanimei-msft
Community Support
Community Support

Hi all , 

@QuentinBl , thanks for your concern about this case, I have some additions for problem solving.

@jwin2424 , thank you for giving a specific description of the problem. Based on your description, I may not be able to understand and solve your problem very well. Depending on the content of your text, I will give you the following steps to solve the problem.

1. Create three tables as the picture you show.

The original Table 1.

vyanimeimsft_0-1711348548979.png

The original Table 2.

vyanimeimsft_1-1711348561129.png

The original Table 3.

vyanimeimsft_2-1711348572911.png

In Table1, New column % to win and input:

 

% to win = LOOKUPVALUE(Table2[% to win],Table2[Concat],Table1[Concat])

 

vyanimeimsft_3-1711348585389.png

In Table 3, New column Concat and input:

 

Concat = LOOKUPVALUE(Table1[Concat],Table1[OPP ID],Table3[OPP ID])

 

2. Manage relationships as the text “Table 1 and Table 3 are joined together with a Many to one reltaionship with the many side being on table 3 and the one side beind on table 1. The cross filter direction with this relationship is 'Both.' They are joined together by the OPP ID. Table 2 is not joined in any way. It is simply a reference table with some % data on it.".

vyanimeimsft_4-1711348681290.png

vyanimeimsft_5-1711348688408.png

3. In table 1, New column primary lookup key as the text “Table 1 is the only table with a stage and a quarter number, so I concated the two together and used it as my primary lookup key.” and input:

 

primary lookup key = CONCATENATE(Table1[Stage],Table1[Close Quarter])

 

vyanimeimsft_6-1711348720679.png

4. The operation as the text “I did a lookup from Table 2 to return to % to win. The value of each OPP ID is on Table 3. I did a lookup with the OPP ID to return the concat value. I used the concat value to lookup from table Table and return the %.” has been done in step1.

5. In Table 3, New column % to win value as the text “ I am trying to get the line items on Table 3 to the value and multiply it by the % to win based on the concat number.” and input:

 

% to win value = Table3[Estimated Value]*RELATED(Table1[% to win])

 

vyanimeimsft_7-1711348766515.png

You can modify the above DAX codes according to your needs.

I have no way of analyzing what you are causing the loop error because I don’t know the data what is.

To better solve your problems, you may need to answer some questions.

1. What is the data you have used in the Measure Test as your picture? Please give the data of table Opportunity ,Opportunity Product, Forecast Statistics with pictures.

vyanimeimsft_8-1711348779701.png

2. What is your desired outcome? Please give your specific requirements and an example diagram of what to expect.

 

 

Best Regards,

Caroline Mei

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This did work. I am hoping you might be able to elaborate a little on why RELATED was necessary for this? I am not sure where the circular dependecy came from. I was able to get the % into table 1, so I am not sure why I couldn't also just lookup the value on pull it into table 3 as well. It doesn't appear as if there is any circular dependency. 

In any case, thank you! It is working now. 

QuentinBl
Helper I
Helper I

Hello, 

Can you not do it in Power query ? If the table 2 only purpose is to give a win % to table 1. 

I tried this and got the same ciclical reference error

= Table.AddColumn(#"Filtered Rows", "Estimated Close Quarter 2", each Table.First(
Table.SelectRows(
Calendar,
each [fiscal_calendardate] = Opportunity[estimatedclosedate]
)
)[fiscal_quarter])

Well, I dont know how to do lookupvalue in power query. I need to lookup the concat value and both the close quarter and stage are calculated columns from the report dashboard. I dont know how to do that in power query. 

Here is an example. How do I do this in power query?

Estimated Close Quarter = LOOKUPVALUE('Calendar'[fiscal_quarter], 'Calendar'[fiscal_calendardate].[Date], Opportunity[estimatedclosedate].[Date])

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.