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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
jzhao
Frequent Visitor

Circular reference calculated columns

I have 2 calculated columns for sales in local currency and sales in USD, the code are the same but the first works fine the second gives me Circular reference error, can anyone help me with this?

 

Step 1 created the share for a column named "share", which is done using the following code:
```
share =
VAR currentid = 'Table1'[ID]
VAR maxrevenue = MAXX(FILTER('Table1', 'Table1'[ID]=currentid), ABS('Table1'[Amount (Local currency)]))
VAR share = 'Table1'[Amount (Local currency)] / maxrevenue * 
RETURN share * 
```

 

Step2-fetch sales from table 2
I also have two other columns called "Sales USD" and "Sales Local Currency", which are calculated using the following code:
```
Sales USD = LOOKUPVALUE('Table2 list'[ Sales (USD)], 'Table2 list'[ID], 'Table1'[ID])
Sales Local Currency = LOOKUPVALUE('Table2 list'[ Sales__Local_currency], 'Table2 list'[ID], 'Table1'[ID])
```
Now, I want to multiply "Sales USD" with "share" for each row. So, I tried the following code:
```

 

Step 3- the error step
Sales Split = CALCULATE(SUMX('Table1', 'Table1'[Sales_Local_currency] * 'Table1'[share]))
```
This gives me the correct result. However, when I tried to do the same for "Sales USD", I got a circular reference error. Can you tell me why?
```
Sales Split USD = CALCULATE(SUMX('Table1', 'Table1'[Sales USD] * 'Table1'[share]))
```

1 REPLY 1
lbendlin
Super User
Super User

Use a proper data model for this, rather than LOOKUPVALUE.  Alternatively push the calculations upstream into Power Query.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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