Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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]))
```
Use a proper data model for this, rather than LOOKUPVALUE. Alternatively push the calculations upstream into Power Query.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
24 | |
12 | |
11 | |
10 | |
9 |
User | Count |
---|---|
18 | |
14 | |
14 | |
13 | |
12 |