Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hello everybody i hope that you are doing well , I'm a beginner on Dax I NEED SOME HELP PLEASE ,I have a table TRANSACTIONS and the other table for EXCHANGE RATE i related thel with *..1 , I want to calculate a multiplication with 3 columns , 2 are price and quantity in transactions table , and the other column rate of changing between currencies in exchange table , what i want to do is first verifiying the currency column on transactions table if it is different to MAD ,then i should multiply price * Quantity * rate of change :
I tried a lot but it does not work :
1 ) this gave me a scaler
Mesure = [Quantité x Prix] * CALCULATE(SUM(EXCHANGE RATE [Taux de change ]) , FILTER('TRANSACTIONS ' , 'TRANSACTIONS '[Devise] <> "MAD" ))
2)
Mesure = SUMX('TRANSACTIONS', IF('TRANSACTIONS' ,
'TRANSACTIONS'[Devise ] <> "MAD" ,
'TRANSACTIONS'[Quantité x Prix]
* (LOOKUPVALUE('TRANSACTIONS[col8],EXCHANGE RATE[Identifiant],
'TRANSACTIONS'[Identifiant]))))
3) I did nit understand the results of this one
Mesure = SUM('Data ANONYM'[Quantité]) * SUM('Data ANONYM'[Prix]) * CALCULATE(SUM(dtRate[Taux de change ]) , FILTER('Data ANONYM' , 'Data ANONYM'[Devise Règ] <> "MAD" ))
THANK YOU IN ADVANCE
I believe you have asked the same question on another post. I have posted a solution:
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Multiplying-3-columns/m-p/1130426#M16766
Let me know if this solves the purpose.
Cheers!
Vivek
If it helps, please mark it as a solution. Kudos would be a cherry on the top :)(Hit the thumbs up button!)
If it doesn't, then please share a sample data along with the expected results (preferably an excel file and not an image)
Visit my blog:
vivran.in/my-blog
Feel free to email me for any BI needs .
Connect on LinkedIn
Follow on Twitter
Hi,
This works with:
TransactionValue = SUMX(Transactions;CALCULATE(MIN(Transactions[Price])*MIN(Transactions[Quantity])* IF(ISBLANK(MIN('Currency'[Currency]));1; MIN('Currency'[Conversion]))))
See image below:
Please note the data model:
Power BI file can be found here.
If this solves your problem please mark as solved. Thanks!
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
Thanks for your reply but i did not mean this :
this is the content of Exchange rate table
Ident Date currency exchange rate
1 28/12 USD 9,53
2 28/12 EUR 10,93
and this is the transactions table :
Ident Price Quantity Devise Règ
1 102 7 10 EUR
2 104 ,08 30 MAD
what I want to do is multiply Price * Quantity * Taux de change with a condition that verify first
if Devise Règ is different to "MAD" then I will this calcul with this : Price * Quantity * Taux de change
else : simply multiply : Price * Quantity
I see,
I made a slight modification so it should meet your requirements:
TransactionValue =
SUMX(Transactions;CALCULATE(MIN(Transactions[Price])*MIN(Transactions[Quantity])* IF(MIN('Transactions'[Devise])="MAD";1; MIN('Currency'[Conversion]))))
Updated file can be found here.
Please accept as solution if this is what you are looking for. Thanks.
Kind regards,
Steve.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
Please let us know if this works for you.
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
suddenly it doesnt work
Can you please provide more information?
Proud to be a Super User!
Awesome Keyboard Shortcusts in Power BI, thumbs up if you like the article
My Community Blog Articles (check them out!)
My Blog - Power M code to automatically detect column types -
How to create test data using DAX!
Thanks for your reply sorry it was a fault :
this is the content of Exchange rate table
Ident Date currency exchange rate
1 28/12/18 USD 9,53
2 28/12/18 EUR 10,93
and this is the transactions table :
Ident Date Price Quantity Devise Règ
1 28/12/18 102 7 10 EUR
2 28/12/18 104 ,08 30 MAD
what I want to do is multiply Price * Quantity * Taux de change with a condition that verify first
if Devise Règ is different to "MAD" then I will this calcul with this : Price * Quantity * exchange rate
else : simply multiply : Price * Quantity
Since the time granularity of both tables is the same, you just use Power Query to perform the calculation of the amount after applying the right exchange rate and create a column with the right amount in the Transactions table. Then it'll be DEAD easy. You will just sum the amounts. You won't even need to import the exchange rate table.
Best
D
I just took the 2 first rows , the calcul up is what they imposed on me to do even I tried a lot it does not work
it's ok thanks for your reply
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
18 | |
15 | |
11 | |
11 | |
8 |
User | Count |
---|---|
24 | |
18 | |
12 | |
11 | |
10 |