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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
aiplbonn
Regular Visitor

The calculation always returns a value without commas

Hey,

I'm stuck on a fairly simple point.
I have an import value in a field. This is usually in euro cents, but can also be in a completely different currency.
To convert this foreign currency into euros, I have a table with currency rates. I also let this currency rate be filled dynamically with the help of a lookup command.
Now I have an amount in cents in column A and the conversion rate in column B. The result of this calculation should now appear in C.
So A*B .

So far so good.

Unfortunately, PowerBi always delivers a result without , . So the calculation becomes

 

6250 * 0.0887 =5543750 and not 554,375.


No matter what I do, format as currency etc., it is never correct.

Even from 2142 Eurocent the calculation makes 2142 € and not 21,42€.

What am I doing wrong?

2023-01-18 10_02_25-new_overview - Power BI Desktop.png

6 REPLIES 6
aiplbonn
Regular Visitor

Thank you all 🙂 This was the mistake

aiplbonn
Regular Visitor

Unfortunately, that changes nothing.

If I select Fix decimal or only decimal as the data type, the result is 5543750.

If I select Decimal for Format, the result is 5543750,00.

 

2023-01-18 11_44_37-new_overview - Power BI Desktop.png

looks like the conversion rate is also a text field, not sure if an implicit cast is messing things up.

I found the error, the exchange rate already did not indicate that it was a decimal number.

But now I have another problem. When I search for the exchange rate, I do it like this

 

LOOKUPVALUE(exchange rate[currencytoEuro],exchange rate[currency_id],VoucherData[currency_id])

 

If no matching exchange rate can be found, a 1 should be inserted.
Previously I did it like this

 

LOOKUPVALUE(exchange rate[currencyToEuro],exchange rate[currency_id],VoucherData[currency_id], "1")

 

But now PowerBi is complaining because the 1 is written as text and not as a number.

 

Expressions that result in the variant data type cannot be used to define calculated columns.

 

How do I ensure that a 1 is inserted when the exchange rate is not found?

just remove the " around the 1.

johnt75
Super User
Super User

The type of the column is text, you need to change it to decimal number or fixed decimal number

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.