cancel
Showing results for
Did you mean:
Highlighted
Frequent Visitor

## Calculate portfolio value per asset

I have next assets portfolio transactions table:

 DATE ASSET-ID ASSET-NAME AMOUNT BALANCE 21.04.2016 2 FB 300 300 01.07.2016 1 AAPL 500 500 10.02.2017 1 AAPL 100 600 15.05.2017 1 AAPL 250 850

Also I have:

• Calendar table (universal DateDim)
• Stock table (stock prices table with DATE, ASSET-ID, PRICE columns). So I have one PRICE column for all assets.
• [Stoсk Price CUR] measure that calculate actual stock price without data gaps

I need a measure that calculate my portfolio total value for each date (without date gaps).

I'm trying to modeling a next algorytm

1. Calculate actual balance for each asset [measure]
Here I use LASTNONBLANK formula

```Balance WoG =
VAR d =
SELECTEDVALUE ( 'Calendar'[Date] )
RETURN
CALCULATE (
LASTNONBLANK(split[end-balance];1);
split[Date] <= d;
CROSSFILTER ( 'Calendar'[Date]; split[date]; NONE )
)```

2. Calculate actual value for each asset [measure]

Here I'm trying to use that formula:

```Asset Value =
CALCULATE([Balance WoG]*[Stock Price CUR])```

That works fine only then I use asset-id as Legend on my chart (see screenshot), but I inderstand, that I need something more savvy

3. Sum all assets value [measure]
Can't understand how to solve it

Dev Report Screenshot

1 ACCEPTED SOLUTION

Accepted Solutions
Frequent Visitor

## Re: Calculate portfolio value per asset

@v-shex-msft., thanks!

The problem was in the data model and my lack of understanding of some DAX functions
So the topic is closed.

2 REPLIES 2
Community Support Team

## Re: Calculate portfolio value per asset

Hi @lnz,

Can you please share some sample data for test?

How to Get Your Question Answered Quickly

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin Sheng
If this post helps, please consider Accept it as the solution to help the other members find it more quickly
Learning resources: Power BI
Frequent Visitor

## Re: Calculate portfolio value per asset

@v-shex-msft., thanks!

The problem was in the data model and my lack of understanding of some DAX functions
So the topic is closed.

Announcements

#### Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

#### Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

#### Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

#### Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

#### Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors