The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello, I would like to ask you for help. I need to calculate Total sales with PLN currency and EUR. I need to calculate in dax Total Sales with EUR currency (every month has different rate). Of course between these tables is relationship - many to 1
Solved! Go to Solution.
I think the DAX below should work, so long as your relationship is set up as I anticipate it is.
VAR Sales_in_Currency =
ADDCOLUMNS (
SUMMARIZE (
'PLN Table',
'PLN Table'[Date]
),
"Amt_In_Currency", SUM(Sales PLN),
"Rate",
CALCULATE (
SELECTEDVALUE ( 'EUR Table'[EUR] )
)
)
VAR calc =
SUMX (
Sales_in_Currency,
[Amt_In_Currency] * [Rate]
)
RETURN
calc
)
It's not clear what you tables are named, so I have done my best to make this easy to see.
If this works, please could you mark this as the solution?
Hi @Jackie003 one possible solution:
create 2 calculated columns in Sales table (order is important) and two measures (starting with M)
Proud to be a Super User!
I think the DAX below should work, so long as your relationship is set up as I anticipate it is.
VAR Sales_in_Currency =
ADDCOLUMNS (
SUMMARIZE (
'PLN Table',
'PLN Table'[Date]
),
"Amt_In_Currency", SUM(Sales PLN),
"Rate",
CALCULATE (
SELECTEDVALUE ( 'EUR Table'[EUR] )
)
)
VAR calc =
SUMX (
Sales_in_Currency,
[Amt_In_Currency] * [Rate]
)
RETURN
calc
)
It's not clear what you tables are named, so I have done my best to make this easy to see.
If this works, please could you mark this as the solution?
I think the DAX below should work, so long as your relationship is set up as I anticipate it is.
VAR Sales_in_Currency =
ADDCOLUMNS (
SUMMARIZE (
'PLN Table',
'PLN Table'[Date]
),
"Amt_In_Currency", SUM(Sales PLN),
"Rate",
CALCULATE (
SELECTEDVALUE ( 'EUR Table'[EUR] )
)
)
VAR calc =
SUMX (
Sales_in_Currency,
[Amt_In_Currency] * [Rate]
)
RETURN
calc
)
It's not clear what you tables are named, so I have done my best to make this easy to see.
If this works, please could you mark this as the solution?
Hi @Jackie003 you need solution in Excel with DAX or in Power BI?
Proud to be a Super User!
In Power Bi.
What's more, every month new currency rate is updated 🙂
Hi @Jackie003 one possible solution:
create 2 calculated columns in Sales table (order is important) and two measures (starting with M)
Proud to be a Super User!
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
21 | |
19 | |
18 | |
16 | |
13 |
User | Count |
---|---|
38 | |
38 | |
23 | |
21 | |
17 |