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

Calculate portfolio value per asset

I have next assets portfolio transactions table:

DATEASSET-IDASSET-NAMEAMOUNTBALANCE
21.04.20162FB300300
01.07.20161AAPL500500
10.02.20171AAPL100600
15.05.20171AAPL250850

 

 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
Highlighted
lnz Frequent Visitor
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.

View solution in original post

2 REPLIES 2
Community Support Team
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, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
Highlighted
lnz Frequent Visitor
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.

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in 2020

New Ranks and Rank Icons in 2020

Read the announcement for more information!

New Kudos Given Badges Coming

New Kudos Given Badges Coming

We're rolling out new Kudos Given badges. Find out how many Kudos you've given.

November 2019 Community Highlights

November 2019 Community Highlights

Get an overview of the events and great community content from November.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)