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!
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
25 | |
18 | |
18 | |
17 | |
16 |
User | Count |
---|---|
29 | |
27 | |
19 | |
15 | |
14 |