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
AndresOHV
Frequent Visitor

Multiply Values of different columns with an IF condition (Card Measure)

Hello!

 

I have two tables:

 

Article idCurrency
1USD
2EUR
3EUR
4EUR

 

 

TransactionArticle idQuantityPrice USD
115100
215100
335100
435100

 

I need to create a measure to multiply the quantity and the price USD, but when an article is registered as currency = EUR, I need to multiply the quantity for the PriceUSD and for a constant that would be the exchange rate.
I was able to do this in a table buy I need to put it also in a card. 

Can anyone help me with this?

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

Hi, @AndresOHV 

Please try formula like

Measure = 
    SWITCH (
        MAX ( Table1[Currency] ),
        "EUR",
            MAX ( Table2[Price USD] ) * MAX ( Table2[Quantity] ) * [rate],
        "USD", MAX ( Table2[Price USD] ) * MAX ( Table2[Quantity] )
    )

If it doesn't work for you, please share more details.

Best Regards,
Community Support Team _ Eason

 

View solution in original post

3 REPLIES 3
v-easonf-msft
Community Support
Community Support

Hi, @AndresOHV 

Please try formula like

Measure = 
    SWITCH (
        MAX ( Table1[Currency] ),
        "EUR",
            MAX ( Table2[Price USD] ) * MAX ( Table2[Quantity] ) * [rate],
        "USD", MAX ( Table2[Price USD] ) * MAX ( Table2[Quantity] )
    )

If it doesn't work for you, please share more details.

Best Regards,
Community Support Team _ Eason

 

Thank you! This worked!

amitchandak
Super User
Super User

@AndresOHV , A new measure like , Assume Table 1 and Table 2 has 1 _m relationship 

 

Sumx(Table2, Var _curr  = related( Table[Currency])

return

if(_curr= "EUR", .98 , 1) *[Price USD] *[Qty])

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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