cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OldN00b
Frequent Visitor

Create Calculated Column for new security trades which shows either current holdings, buys, sells

Hi Guys - newbie here, i am trying to add a column which identifies new trades between two dates (current week and prior week) with the goal to calculate the total value of new trades , sells, and existing holdings. 

 

My data set looks something like this (Type of Holding is what I want the calculated column to look like)

OldN00b_1-1667589486726.png

 

Link to sample dataset: https://docs.google.com/spreadsheets/d/e/2PACX-1vQQCHpm7AAomMcuPlExXjY3tYnj7WzLkiZXfPUvL6FHtzMUc-unt...

 

I would like to use this column to track the changes in face value using a decomposition tree (something similar to the below example).

 

OldN00b_0-1667588171983.png

 

2 REPLIES 2
daXtreme
Super User
Super User

"i am trying to add a column which identifies new trades between two dates"

 

Yeah... we'd like to be able to identify them as well but we don't know the rule that does it.

amitchandak
Super User
Super User

@OldN00b , Logic is not very clear . But Rank on Position date and earlier will help

 

Rank = Rankx(Table, Table[Position date],,asc, dense)

 

Last week same stock = sumx(filter(Table,[Position] = earlier([Position ID] ) && [Rank] = earlier([Rank]) -1) , [Original face value])

 

 

Next week same stock = sumx(filter(Table,[Position] = earlier([Position ID] ) && [Rank] = earlier([Rank]) +1) , [Original face value])

 

These three columns can help you

 

Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8

 

The information you have provided is not making the problem clear to me. Can you please explain with an example.

Appreciate your Kudos.



Learn Power BI - Full Course with Dec-2022, with new DAX functions like Window, Index, Offset !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Formatted Profit and Loss Statement with empty lines

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors