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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
MBrackenbury
New Member

Infinity / NaN error

HI

 

I am using the following statement in a measure which takes the value in the transactional currency and converts it to the local currency. 

 

GBP Invoice COGS Value = sumx('Sales_Invoice_Data','Sales_Invoice_Data'[Standard Cogs ] / LOOKUPVALUE('CurrencyTable'[Value], 'CurrencyTable'[Date], 'Sales_Invoice_Data'[Invoice Date], 'CurrencyTable'[Rate], 'Sales_Invoice_Data'[Local Currency Code]))

 

The calculation seems to work fine and creates the column OK in the table with the correct data but when I then apply it to a BI report i get infinity errors.

 

I think i need to change the statement so that it handles a 0 but all the options i have tried failed.

Any help would be appreciated.

Thanks

Mark

 

 

Capture.JPG

 

 

4 REPLIES 4
edejes2
Advocate IV
Advocate IV

Hello @MBrackenbury

 

This issues its based on the fact that you are using/sign you will need to use the DIVIDE function instead. 

 

Regards!

ED

HI Ed

 

Thank you for the reply however I did try using the divide option previously and couldn't get it to work - possible due to the divide being based on a lookup value.

 

Where in the statement are you saying I need to use the DIVIDE()?

 

GBP Invoice COGS Value = sumx('Sales_Invoice_Data','Sales_Invoice_Data'[Standard Cogs ] / LOOKUPVALUE('CurrencyTable'[Value], 'CurrencyTable'[Date], 'Sales_Invoice_Data'[Invoice Date], 'CurrencyTable'[Rate], 'Sales_Invoice_Data'[Local Currency Code]))

 

Thanks

Mark

HI

 

Has anyone got another solution to this issue as i still cannot get it to work.

 

Thanks

Mark

Anonymous
Not applicable

Hi @MBrackenbury,

 

You can try to use below measure:

GBP Invoice COGS Value =
SUMX (
    'Sales_Invoice_Data',
    DIVIDE (
        'Sales_Invoice_Data'[Standard Cogs ],
        LOOKUPVALUE (
            'CurrencyTable'[Value],
            'CurrencyTable'[Date], 'Sales_Invoice_Data'[Invoice Date],
            'CurrencyTable'[Rate], 'Sales_Invoice_Data'[Local Currency Code]
        ),
        -1
    )
)

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.