March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi All
I have two tables
Table 1 with Stock names and the quantity purchased
Table 2 with Last 1 year Historic prices of each stock
I have a two measure
1. Measure 1 - total quantity which is the sum of all the quantites of the stock
2. Measure 2 - Last Traded Price = This gives the Last trade price of each stock on the last traded date say 13th Jan 2023
I want to calculate the portfolio value on the Last Traded Date which should be simply the the sumproduct of quantity i have (measure 1) and the Last traded price (measure 2) for each stock
Thanks in Advance
Solved! Go to Solution.
Oh i didnt see your latest reply of thr table please try
Hello @baronraghu_3011 can you please share the measures as well as providing a sample of your data would help a lot
HI,
table 1 has two columns
Column 1 - stock name
Column 2 - quantity
Measure 1 - Sum( Table1[quantity])
Table 2 has tow columns
Column 1 - Stock Name
Colume 2 - Date
Column 3 - Daily Stock Price
I craeted a two refernce Measure for the
1. Last Trading Date = Today()-2
2. Stock Price = Sum (Table 2[Stock Price])
Measure 2 - Last Trading Price = calculate (Stock Price, Filter( Date, Date[Date]= Last Trading Date))
For calculating my total Portfolio Value = Measure 1 ( Total Quantity)* Measure 2 ( Last Trading Price) .
This I understand maynot give correct value as the quantity is multiplied with all the stock prices. So i believe it must be sum product. But hoe to apply has been my concern.
I think youcan try a sumx measure
Sumx(values(table[date]),measure1 * measure 2)
@baronraghu_3011 Hard to say with the information provided but, perhaps this is the classic measure totals problem?
First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e
This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8
Hi,
Thanks for those links. I understand a bit that using Hasonefilter along with SUMX might turnaround the table the way I want to look but finding it hard to implement. I have shared snap of my table below for your refernce. The red circle is my issue which doesnt add up.
Oh i didnt see your latest reply of thr table please try
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
User | Count |
---|---|
26 | |
21 | |
20 | |
13 | |
12 |
User | Count |
---|---|
40 | |
27 | |
27 | |
21 | |
19 |