The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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!
User | Count |
---|---|
11 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
24 | |
14 | |
13 | |
9 | |
7 |