Forum Discussion
Anonymous
3 years agoNot applicable
Create a Line Graph showing changes to a portfolio over time using the most recent values by month
Hello, I've spent quite some time trying to figure this on my own and diving deep into the forums and haven't come away with a clear answer, so I'm hoping someone here can guide me in the right direc...
- 3 years ago
- Anonymous3 years ago
Thanks, this is it. So folks are aware or the OneDrive link inevitably dies, here's the logic.
You need to create a calendar table (date dim)
Calendar = CALENDAR(MIN(Data[Created_Date]),EOMONTH(MAX(Data[Created_Date]),0))Sum your cost from the Data Table
TC = SUM(Data[Total Cost])Use the following measure:
Measure = CALCULATE([TC],LASTNONBLANK(CALCULATETABLE('Calendar',DATESBETWEEN('Calendar'[Date],minx(ALL('Calendar'),'Calendar'[Date]),max('Calendar'[Date]))),CALCULATE([tc])))Lastly, do the following:
Measure 3 = SUMX(CALCULATETABLE(VALUES(Data[Portfolio]),all('Calendar')),[Measure])I had to replace the VALUES(Data[Portfolio]) with SUMMARIZE(Data, Data[Column 1], Data[Column 2], etc) to get what I wanted.
Anonymous
3 years agoNot applicable
Thanks, this is it. So folks are aware or the OneDrive link inevitably dies, here's the logic.
You need to create a calendar table (date dim)
Calendar = CALENDAR(MIN(Data[Created_Date]),EOMONTH(MAX(Data[Created_Date]),0))
Sum your cost from the Data Table
TC = SUM(Data[Total Cost])
Use the following measure:
Measure = CALCULATE([TC],LASTNONBLANK(CALCULATETABLE('Calendar',DATESBETWEEN('Calendar'[Date],minx(ALL('Calendar'),'Calendar'[Date]),max('Calendar'[Date]))),CALCULATE([tc])))
Lastly, do the following:
Measure 3 = SUMX(CALCULATETABLE(VALUES(Data[Portfolio]),all('Calendar')),[Measure])I had to replace the VALUES(Data[Portfolio]) with SUMMARIZE(Data, Data[Column 1], Data[Column 2], etc) to get what I wanted.
Ashish_Mathur
Super User
3 years agoYou are welcome.