The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello!
I have two tables:
Article id | Currency |
1 | USD |
2 | EUR |
3 | EUR |
4 | EUR |
Transaction | Article id | Quantity | Price USD |
1 | 1 | 5 | 100 |
2 | 1 | 5 | 100 |
3 | 3 | 5 | 100 |
4 | 3 | 5 | 100 |
I need to create a measure to multiply the quantity and the price USD, but when an article is registered as currency = EUR, I need to multiply the quantity for the PriceUSD and for a constant that would be the exchange rate.
I was able to do this in a table buy I need to put it also in a card.
Can anyone help me with this?
Solved! Go to Solution.
Hi, @AndresOHV
Please try formula like
Measure =
SWITCH (
MAX ( Table1[Currency] ),
"EUR",
MAX ( Table2[Price USD] ) * MAX ( Table2[Quantity] ) * [rate],
"USD", MAX ( Table2[Price USD] ) * MAX ( Table2[Quantity] )
)
If it doesn't work for you, please share more details.
Best Regards,
Community Support Team _ Eason
Hi, @AndresOHV
Please try formula like
Measure =
SWITCH (
MAX ( Table1[Currency] ),
"EUR",
MAX ( Table2[Price USD] ) * MAX ( Table2[Quantity] ) * [rate],
"USD", MAX ( Table2[Price USD] ) * MAX ( Table2[Quantity] )
)
If it doesn't work for you, please share more details.
Best Regards,
Community Support Team _ Eason
Thank you! This worked!
@AndresOHV , A new measure like , Assume Table 1 and Table 2 has 1 _m relationship
Sumx(Table2, Var _curr = related( Table[Currency])
return
if(_curr= "EUR", .98 , 1) *[Price USD] *[Qty])
User | Count |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |