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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Jordan-Adrian
New Member

Portfolio Value Over Time

I have a Projects table containing a potfolio of projects. Each project has a Start Date and an End Date as well as a Total Value. Although I do have a date table, I dont use it often because I use mutliple date filters based on multiple date columns, all requiring a custome financial year, so I find it easier to create fiscal year and quarter columns, as caculate columns, for each date in the Projects table - I'm not sure how relevant this is but wanted to mention it. Regardless, I have an active date table relationship with the Start Date and an inactive date table relaionship with the End Date. 

 

I'd like to create a calculation that sums the total value of the portfolio over time. So in a line graph, for any given day, I want to see the sum Total Value of all Start Dates on or before the given day minus the sum Total Value of all End Dates on or before that given day. I need this to react to both my Start Date and End Date filters - which I currently have setup using my Start Date and End Date columns directly in the Project table. 

 

Here is a sample table:

 

IDProject NameStart DateEnd DateLastest USD Value
8Iron Man6/28/20206/28/2023100000
9Batman2/14/20212/14/202240000
42Spiderman5/5/20205/5/202210000
52Hulk10/1/20201/1/20221000000
57Wolverine7/1/20237/1/2025750000
79Daredevil9/1/20199/1/202360000
90Superman1/1/20215/1/2021100000
93Wonder Woman3/23/20223/1/202435000
133Thor5/9/20225/14/20262000000
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Jordan-Adrian ,

 

According to your statement, I think you can try code as below to create a measure.

Measure = 
VAR _SELECTION = SELECTEDVALUE('Calendar'[Date])
VAR _SUM1 = CALCULATE(SUM('Table'[Lastest USD Value]),FILTER('Table','Table'[Start Date]<=_SELECTION))
VAR _SUM2 = CALCULATE(SUM('Table'[Lastest USD Value]),FILTER('Table','Table'[End Date]<=_SELECTION))
RETURN
_SUM1 - _SUM2

Result is as below.

vrzhoumsft_0-1704098909315.png


Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Jordan-Adrian ,

 

According to your statement, I think you can try code as below to create a measure.

Measure = 
VAR _SELECTION = SELECTEDVALUE('Calendar'[Date])
VAR _SUM1 = CALCULATE(SUM('Table'[Lastest USD Value]),FILTER('Table','Table'[Start Date]<=_SELECTION))
VAR _SUM2 = CALCULATE(SUM('Table'[Lastest USD Value]),FILTER('Table','Table'[End Date]<=_SELECTION))
RETURN
_SUM1 - _SUM2

Result is as below.

vrzhoumsft_0-1704098909315.png


Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ritaf1983
Super User
Super User

Hi @Jordan-Adrian 

If i understood you correctly you can use a disconnected dates table 

Ritaf1983_0-1703914469083.png

And dax 

portfolio_value =
VAR selectedDate = MAX('calendar'[Date])

RETURN

SUMX('portfolio',
VAR StartDate = [Start date]
VAR EndDate = [End Date]
RETURN IF(StartDate<= selectedDate && OR(EndDate>=selectedDate, EndDate=BLANK() ),[Lastest USD Value],0)
)
Ritaf1983_1-1703914545703.png

pbix is attached

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.