cancel
Showing results for
Did you mean:
Frequent Visitor

## SUMX with measures expression for categories by date

Hi, guys

To calculate stocks portfolio yield dynamic I need to calculate my [Potfolio Total Value] for allselected stocks by date

• [Asset Current Amount]
• [dev Asset Current Price] - I think this measure need some changes
• [Asset Current Value] = [Asset Current Amount] * [dev Asset Current Price]
• [Total Current Amount] - Total amount of shares in portfolio
• [dev Portfolio Current Value] - Total value of portfolio

[dev Portfolio Current Value] code:

```dev Portfolio Current Value =
VAR d = MAX('calendar'[Date])
RETURN
CALCULATE(
SUMX(VALUES('split'[asset-id]);
[Asset Current Value]
);
FILTER(
ALL('calendar');
'calendar'[Date] <= d
)
)```

I expect to recive [dev Portfolio Current Value] = 206 359,50 at 16.11.2018 (16th November 2018)
But I've got 222 559,50 because [Asset Current Price] = 193,53 both for Apple and Facebook

How could I fix my formulas to sum [amount]*[price] for each asset-id per day

PBI Project Here

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support Team

## Re: SUMX with measures expression for categories by date

@lnz,

Change it as follows.

`VALUES ( company[ticker] )`
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Community Support Team

## Re: SUMX with measures expression for categories by date

@lnz,

Change it as follows.

`VALUES ( company[ticker] )`
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Announcements

#### Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

#### Power Platform Summit North America

Register by September 5 to save \$200

#### Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 150 members 1,670 guests
Recent signins: