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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Arnaud31450
Frequent Visitor

Multiply based on currency check

Hi everyone,

 

I have values in the table "Price List item" stored as local currencies "Range1_c" e.g. 1,000

In this table I have "CurrencyIsoCode" e.g. EUR

 

In another Table "Table" I have values "Fxb Rate 2022" e.g. 0.22

In this "Table" I have "Currency" e.g. EUR which is linked to "CurrencyIsoCode" in my other table "ProductPricing"

 

I would like to create a new measure which is "Range1_USD" that takes "Range1_c" check its "CurrencyIsoCode" and multiply by "Fxb Rate 2022" corresponding value based on "Currency"

 

Thanks for the help.

2 ACCEPTED SOLUTIONS
smpa01
Super User
Super User

@Arnaud31450  can you try this measure

Measure =
CALCULATE (
    SUMX (
        'Price List item',
        VAR _0 = 'Price List item'[Range1_c]
        VAR _1 =
            CALCULATE (
                MAX ( 'Table'[Fxb Rate 2022] ),
                TREATAS ( VALUES ( 'Price List item'[CurrencyIsoCode] ), 'Table'[Currency] )
            )
        RETURN
            _0 * _1
    )
)
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

@Arnaud31450  looks like you missed a comma after SUMX ('Price List item'

 

Measure =
CALCULATE (
SUMX (
'Price List item',
VAR _0 = 'Price List item'[Range1_c]
VAR _1 =
CALCULATE (
MAX ( 'Table'[Fxb Rate 2022] ),
TREATAS ( VALUES ( 'Price List item'[CurrencyIsoCode] ), 'Table'[Currency] )
)
RETURN
_0 * _1
)
)

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

5 REPLIES 5
Arnaud31450
Frequent Visitor

Thanks a lot everyone for the Help !

v-yalanwu-msft
Community Support
Community Support

Hi, @Arnaud31450 ;

You could create a measure as follows:

Range1_USD = SUM('Table'[Fxb Rate 2022])*CALCULATE( SUM('Price List item'[Range1_c]),FILTER('Price List item',[CurrencyIsoCode]=MAX('Table'[Currency])))

The final output is shown below:

vyalanwumsft_0-1638852646646.png

If this formula does not apply to your data, can you share the relationship of your data or more details?


Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Arnaud31450
Frequent Visitor

Superb !

But I think I have problems with my Range1_c

Arnaud31450_1-1638465324708.png

 

 

Arnaud31450_0-1638465241071.png

Which would correlate also with the fact that I can't make this one work (it still give old value and do not get me a value with the selected multiplier

Arnaud31450_2-1638465424505.png

 

@Arnaud31450  looks like you missed a comma after SUMX ('Price List item'

 

Measure =
CALCULATE (
SUMX (
'Price List item',
VAR _0 = 'Price List item'[Range1_c]
VAR _1 =
CALCULATE (
MAX ( 'Table'[Fxb Rate 2022] ),
TREATAS ( VALUES ( 'Price List item'[CurrencyIsoCode] ), 'Table'[Currency] )
)
RETURN
_0 * _1
)
)

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
smpa01
Super User
Super User

@Arnaud31450  can you try this measure

Measure =
CALCULATE (
    SUMX (
        'Price List item',
        VAR _0 = 'Price List item'[Range1_c]
        VAR _1 =
            CALCULATE (
                MAX ( 'Table'[Fxb Rate 2022] ),
                TREATAS ( VALUES ( 'Price List item'[CurrencyIsoCode] ), 'Table'[Currency] )
            )
        RETURN
            _0 * _1
    )
)
Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors