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
ANM_97
Helper IV
Helper IV

Multiplying the value of the exchange rate

Hello!

 

I have this situation:

 

VALUERATERESULT
10004.5222.2222
25004.5555.5556
100 Infinity
5004.5222.2222
2000 Infinity

 

How could I divide all the VALUES to the value 4.5? I should build a measure that will take that rate of exchange rate and use it in dividing.

 

I need help!

Thank you~

 

1 ACCEPTED SOLUTION

Hi @ANM_97 ,

Sorry for late back. Please try like this:

Measure = 
VAR vvalue =
    SUM ( 'Table'[VALUE IN CURRENCY= RON] )
VAR vmax =
    CALCULATE (
        MAX ( 'Table'[RATE] ),
        FILTER ( ALL ( 'Table' ), 'Table'[CURRENCY] = "EUR" )
    )
RETURN
    DIVIDE ( vvalue, vmax )

1.PNG

If you will use a slicer to change currency, you could try like this:

  • Create a new irrelevant table.
Filter Table = VALUES('Table'[CURRENCY])
  • Create a measure
Measure 2 = 
var vSelectedCurrency = SELECTEDVALUE('Filter Table'[CURRENCY])
VAR vvalue =
    SUM ( 'Table'[VALUE IN CURRENCY= RON] )
VAR vmax =
    CALCULATE (
        MAX ( 'Table'[RATE] ),
        FILTER ( ALL ( 'Table' ), 'Table'[CURRENCY] = vSelectedCurrency )
    )
RETURN
  IF(ISFILTERED('Filter Table'[CURRENCY]),  DIVIDE ( vvalue, vmax ),SUM('Table'[VALUE IN CURRENCY= RON])
)

2.PNG

For more details, please see the attachment.

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
amitchandak
Super User
Super User

@ANM_97 ,Try Divide by 4.5 when blank

divide([value],if(isblank([RATE]),4.5,[RATE]))

 

az38
Community Champion
Community Champion

Hi @ANM_97 

just create a new column and use it in your measures

Column = DIVIDE([Value], 4.5)

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

The value 4.5 is not static, it changes daily.

I need to take this value daily in a masure and realize the division. 

It depend on context, you can something like

divide(sum([value]),if(isblank(max([RATE])),4.5,max([RATE])))

divide(sum([value]),if(isblank(max([RATE])),max([RATE]),max([RATE])))

I need to always divide by the first value that is not NULL.

Hi @ANM_97 ,

So for the sample, the value of 100 should divide 4.5 as well. And the result should be 22.22. Right?  If so, please try like this:

Measure = 
var vvalue = SUM('Table'[VALUE])
var vmax = CALCULATE(MAX('Table'[RATE]),ALLSELECTED('Table'))
return
DIVIDE(vvalue,vmax)

2.PNG 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello,

Thank you for help!~


I probably didn't explain the situation correctly.

I have this table:

Date ex: 2020/02/28

CLIENTVALUE IN CURRENCY= RONRATECURRENCYVALUE_EUR
A5002.6AUD                   104.17 =500/4.8
B2003.1CAD                     41.67
C1504.8EUR                     31.25
D1005.3GBP                     20.83
E6000.4NOK                   125.00

 

How can I divide all the values in the VALUE column at the EURO exchange rate (it is influenced by the date, it is not static), without being influenced by the rest of the currencies?

 

VALUE_EUR is the expected result.

 

If I use this masure:

Measure = 
var vvalue = SUM('Table'[VALUE])
var vmax = CALCULATE(MAX('Table'[RATE]),ALLSELECTED('Table'))
return
DIVIDE(vvalue,vmax)

 

Obtain the following results:

 

CLIENTVALUE IN CURRENCY= RONRATECURRENCYVALUE_EUR
A5002.6AUD

                   192.31=500/2.6

 

B2003.1CAD                 64.52
C1504.8EUR                     31.25
D1005.3GBP                     18.87
E6000.4NOK               1,500.00



Hi @ANM_97 ,

Sorry for late back. Please try like this:

Measure = 
VAR vvalue =
    SUM ( 'Table'[VALUE IN CURRENCY= RON] )
VAR vmax =
    CALCULATE (
        MAX ( 'Table'[RATE] ),
        FILTER ( ALL ( 'Table' ), 'Table'[CURRENCY] = "EUR" )
    )
RETURN
    DIVIDE ( vvalue, vmax )

1.PNG

If you will use a slicer to change currency, you could try like this:

  • Create a new irrelevant table.
Filter Table = VALUES('Table'[CURRENCY])
  • Create a measure
Measure 2 = 
var vSelectedCurrency = SELECTEDVALUE('Filter Table'[CURRENCY])
VAR vvalue =
    SUM ( 'Table'[VALUE IN CURRENCY= RON] )
VAR vmax =
    CALCULATE (
        MAX ( 'Table'[RATE] ),
        FILTER ( ALL ( 'Table' ), 'Table'[CURRENCY] = vSelectedCurrency )
    )
RETURN
  IF(ISFILTERED('Filter Table'[CURRENCY]),  DIVIDE ( vvalue, vmax ),SUM('Table'[VALUE IN CURRENCY= RON])
)

2.PNG

For more details, please see the attachment.

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.