Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register 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
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
17 | |
16 | |
13 | |
9 | |
9 |
User | Count |
---|---|
14 | |
10 | |
6 | |
6 | |
5 |