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.
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.
User | Count |
---|---|
28 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |