Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
DEA
Frequent Visitor

Change in shares

Hi, 

new to this ... 

I have a dataset with portfolio data at multiple dates.

My columns are dates, security ID and Shares.

I want a visual in which the user could select a time period (via a slicer with the date field in it) and gets the change in shares between the beginning and end date.

For example, if the user selects a time period of the past 7 days and the portfolio had 10 shares of xyz at the beginning of period and 50 shares of xyz at the end of period, i want the user to see a table that shows XYZ and 40 shares (50-10).

 

I am not sure how to organise my data to set this up in an efficient manner.  

 

4 REPLIES 4
mussaenda
Super User
Super User

hi @DEA 

Please provide a sample data and your desired output to help you easier.

Thank you!

sturlaws
Resident Rockstar
Resident Rockstar

Hi, @DEA 

if you include a (scrubbed) sample of you data, it will be easier to help you.

 

What you can do to solve your case, is to create a stand alone table with the actual periods you want available. In the .pbix-file in the link,  I created Last 7 days and Last 14 days. The calculation is performed depending on which of these are selected, based on todays date. This works as long as you have data for every day. If you have gaps in your data, the solution would have to be more complex.

 

 

.pbix file
excel mockup input

DEA
Frequent Visitor

Not sure how to attach the data ... i pasted sample data below

I want the user to select a date range (for example 08/26/2019 to 08/27/2019)

and the user would receive the list of IDs for which the # of shares changed (for example, with the sample data below, the user would see a table:

 

thanks for your help. 

 

ID Change in Shares

1 30000000

 

Date class ID shares price ai weight Duration MV
2019-08-27 bench1 1 190073581 94 0.08 0.10 21.3 178,821,225
2019-08-27 bench1 2 168394639 91 1.89 0.09 16.7 156,421,780 
2019-08-26 bench1 1 220073581 94 0.08 0.12 11.2 207,045,225
2019-08-26 bench1 2 168394639 91 1.89 0.09 13.7 156,421,780

Hi @DEA ,

 

Use a slicer for your dates and set it as between

2019_09_01_11_08_41_Accounts_Receivable_Aging_Power_BI_Desktop.png

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.