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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
deepakb18
Helper I
Helper I

Change the calculation to all page based on User Input

Hi Experts

 

I have one requirement. I have one table that contains Accont Number, Amount, Amount Currency as below

 

Capture.PNG

 

Now I need to take user input of exchange rate for USD, EUR from user in One Page. Now what we require is on Page 2 we want to show chart Account wise total Amount based on exchange rate selected by user. Page 3 also have some calculation/char based on Page 1 exchange rate, that also need to change.

 

Please help how to achive as I tried several optios. 

1 ACCEPTED SOLUTION

Hi @deepakb18,

 

On Dax you can use a SWITCH function that is a supersize IF that allow to make several IF, check the link with the explanation.

 

Regarding your formula using the above syntax you should use the following:

 

TOTAL Value =
SWITCH (
    TRUE ();
    MAX ( Table[Account_Currency] ) = "USD"; SUM ( 'Total Population'[Account Balance Value Reported] )
        * MAX ( Rate_USD[Rate_USD Value] );
    MAX ( Table[Account_Currency] ) = "EUR"; SUM ( 'Total Population'[Account Balance Value Reported] )
        * MAX ( Rate_USD[Rate_EUR Value] );
    SUM ( 'Total Population'[Account Balance Value Reported] )
)

You should add the as many parameter as table you need the last one is the If nothing of the above happens returns in this case I return the actuals value.

 

This is the values you should increment in each of your exchange rate (change AAA by your exchange rate):

MAX ( Table[Account_Currency] ) = "AAA"; SUM ( 'Total Population'[Account Balance Value Reported] )
        * MAX ( Rate_AAA[Rate_AAA Value] )

 

Regards,

MFelix

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi,

 

Why can't you create a slicer form the Amount Currency column and a visual with Account Number and Amount.  When you select any item in the sliccer, your visual will change.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Ashish

 

User needs to provide exchange rate for all or some currency. Example for US he can give 0.90 and for Euro 0.80 then based on amount currency type you should calculate the final amount against each account.

 

 

MFelix
Super User
Super User

Hi @deepakb18,

To achieve this you need to use the what if analsys ti make the exchange rate slicer.

https://docs.microsoft.com/en-us/power-bi/desktop-what-if

Combine this with the slicer syncronization

https://docs.microsoft.com/en-us/power-bi/desktop-slicers

Not in the computer right now but follow the links and tell me if you have any isues.

Regards,
MFelix

Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi MFelix

 

Thanks for your reply. Now with the help of your links, I created 4 Parameter for exchange Rate like "Rate_US", "Rate_Ind", "Rate_EUR". Also I have sync slicer to both page and hide slicer from Page 2. Though calculation is not coming accurately but its changing. Now will you help me to write case statement for new measure to calcuate amount * ExchangeRate based on their Account_currency Coulmn .

 

Measure Amount After ExchangeRate = Sum('Total Population'[Account Balance Value Reported])*Rate_USD[Rate_USD Value].

 

I am new in DAX, Appreciate your help. I Need Measure to calculate like this

 

If(Account_Currency =USD, Sum('Total Population'[Account Balance Value Reported])*Rate_USD[Rate_USD Value])

else if (Account_Currency =EUR, Sum('Total Population'[Account Balance Value Reported])*Rate_USD[Rate_EUR Value])

etc etc.

Hi @deepakb18,

 

On Dax you can use a SWITCH function that is a supersize IF that allow to make several IF, check the link with the explanation.

 

Regarding your formula using the above syntax you should use the following:

 

TOTAL Value =
SWITCH (
    TRUE ();
    MAX ( Table[Account_Currency] ) = "USD"; SUM ( 'Total Population'[Account Balance Value Reported] )
        * MAX ( Rate_USD[Rate_USD Value] );
    MAX ( Table[Account_Currency] ) = "EUR"; SUM ( 'Total Population'[Account Balance Value Reported] )
        * MAX ( Rate_USD[Rate_EUR Value] );
    SUM ( 'Total Population'[Account Balance Value Reported] )
)

You should add the as many parameter as table you need the last one is the If nothing of the above happens returns in this case I return the actuals value.

 

This is the values you should increment in each of your exchange rate (change AAA by your exchange rate):

MAX ( Table[Account_Currency] ) = "AAA"; SUM ( 'Total Population'[Account Balance Value Reported] )
        * MAX ( Rate_AAA[Rate_AAA Value] )

 

Regards,

MFelix

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Hi MFelix

 

 

One observation in your formaula

 

TOTAL Value =
SWITCH (
    TRUE ();
    MAX ( Table[Account_Currency] ) = "USD"; SUM ( 'Total Population'[Account Balance Value Reported] )
        * MAX ( Rate_USD[Rate_USD Value] );
    MAX ( Table[Account_Currency] ) = "EUR"; SUM ( 'Total Population'[Account Balance Value Reported] )
        * MAX ( Rate_USD[Rate_EUR Value] );
    SUM ( 'Total Population'[Account Balance Value Reported] )
)

 

 MAX ( Table[Account_Currency]  will always come as USD so all the currency is getting calculated based on USD Rate. how to resolved this.

 

Also based on below input file, can we create & calculate the amount based on exchange rate ?

 

 

Currency RateCalculated Amount
Based on USD Rate Parameter="Account Balance Value Reported" * USD Rate Exchange

 

Input file

DivisionAccount NumberAccount Balance Value ReportedAccount Currency
Business Unit 3101210480301602GBP
Business Unit 3101210485347462GBP
Business Unit 31012106942800000GBP
Business Unit 1101210527382666GBP
Business Unit 1101210534231914GBP
Business Unit 1101210445263349GBP
Business Unit 1101210528303572GBP
Business Unit 3101210668805000GBP
Business Unit 4101456780132915USD
Business Unit 21012104721300000GBP
Business Unit 410121054652072GBP
Business Unit 4101210545216685GBP
Business Unit 110121051196923GBP
Business Unit 110121051224154GBP
Business Unit 4101210816355447USD
Business Unit 3101210701266388USD
Business Unit 31012107111200000GBP

 

 Looking forward of your reply. Please !!!!

Hi @deepakb18,

 

The SWITCH fornula was based on your explanation that you create a 4 parameter table changig the value of the exchange rate and that you wanted several nested IF's so you should add a statment for each of the exchange rate you have.

 

How are you presenting the values? In a card? in a chart?

 

You need to had context on the visual you need for example place a slicer or a visual filter where you select the exchange rate to USD, EUR, whatever based on the column Account currency that will give you the expected values.

 

Regarding the second part of your question do you want to calculate to all rows the value multiplied by the exchange rate? So when you have USD gives amount * 1 when it's GBP gives the amount * exchange rate?

 

Regards,

MFelix

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Let me give you full details

 

A. 

CurrencyRate
USD0.7
EUR0.8
INR0.6

 All are created as Parameter by using What If Paramaeter

 

B. Input Data

BUAccount NoAmountCurrency
BU 1101100USD
BU 1102200EUR
BU 1103300USD
BU 1104400USD
BU 2104500EUR
BU 2106600USD
BU 2102300USD
BU1106300

EUR

 

Step 1 : To calculate  Amout After Exchange Rate Conversion

BUAccount NoAmountCurrencyFinal Amount
BU 1101100USD70
BU 1102200EUR160
BU 1103300USD210
BU 1104400USD280
BU 2104500EUR400
BU 2106600USD420
BU 2102300USD210
BU1106300EUR240

 

Step 2 : Find the Maximum Final Amount from Each Account No

Account NoMAX Final Amount
10170
102210
103210
104400
106420

 

 

Step 3 : Take Distinct BU & Account No from Step 1

BUAccount No
BU 1101
BU 1102
BU 1103
BU 1104
BU 2104
BU 2106
BU 2102
BU1106

 

 

Step 4: Lookup the Amount from each account no from step 3

BUAccount NoFinal MAX Amount
BU 110170
BU 1102210
BU 1103210
BU 1104400
BU 2104400
BU 2106420
BU 2102210
BU1106420

 

USE Treemap Chart to plot between BU & Final Max Amount

 

Hi Felix

 

Thanks for you quick reply and solution. However I changed calculation to fit the exact requirement.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors