Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
hii~
I need help in finding this relative price( to find profit/loss),where i need to subtract Traded Price(from Sample Transactions table) with Market Price(from Price table), based on the columns of buy/sell (from Sample Transactions table).
Here is what i did, but it can't be calculated and I can't put it in the matrix table.
Solved! Go to Solution.
Hi, @camelia_ ;
Try it.
Measure =
IF (
MAX ( 'Sample Transactions'[Buy/Sell] ) = "Sell",
SUM ( 'Sample Transactions'[Total Trade Price*] ) - SUM ( 'Price'[PRICE] ),
IF (
MAX ( 'Sample Transactions'[Buy/Sell] ) = "Buy",
-1
* ( SUM ( 'Sample Transactions'[Total Trade Price*] ) - SUM ( 'Price'[PRICE] ) ),
BLANK ()
)
)
or
Column =
IF (
'Sample Transactions'[Buy/Sell] = "Sell",
'Sample Transactions'[Total Trade Price*] - SUM ( 'Price'[PRICE] ),
IF (
'Sample Transactions'[Buy/Sell] = "Buy",
-1
* ( 'Sample Transactions'[Total Trade Price*] - SUM ( 'Price'[PRICE] ) ),
BLANK ()
)
)
Best Regards,
Hi, @camelia_ ;
Try it.
Measure =
IF (
MAX ( 'Sample Transactions'[Buy/Sell] ) = "Sell",
SUM ( 'Sample Transactions'[Total Trade Price*] ) - SUM ( 'Price'[PRICE] ),
IF (
MAX ( 'Sample Transactions'[Buy/Sell] ) = "Buy",
-1
* ( SUM ( 'Sample Transactions'[Total Trade Price*] ) - SUM ( 'Price'[PRICE] ) ),
BLANK ()
)
)
or
Column =
IF (
'Sample Transactions'[Buy/Sell] = "Sell",
'Sample Transactions'[Total Trade Price*] - SUM ( 'Price'[PRICE] ),
IF (
'Sample Transactions'[Buy/Sell] = "Buy",
-1
* ( 'Sample Transactions'[Total Trade Price*] - SUM ( 'Price'[PRICE] ) ),
BLANK ()
)
)
Best Regards,
hii @YalanWu_test
If i have this function,
omg it worked,thanks a lot!
@camelia_ , You need to create a common column and then you can take diff of measures from two tables against common dimensions
Hi @amitchandak , I already have the combined table like in attached link, its just that i can't subtract it since it involves 2 different tables with condition.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
48 | |
26 | |
20 | |
15 | |
12 |
User | Count |
---|---|
57 | |
49 | |
43 | |
19 | |
18 |