March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi everyone,
I have some monthly portfolio performance data on hand, along with the starting month for each portfolio.
Additionally, I have historical monthly performance data for 3 benchmarks from a long time ago until latest Month (Today).
I would like to create a line chart with the following specifications, which I've serach & tried so many DAX, but all fail:
* Total returns on $100 USD: Set the starting point for each portfolio as 100 from one month before each portfolio's start month.
* Select one Porfolio at a time the line chart should display that portfolio and all 3 benchmarks, all starting from 100.
* The next month's number for each line should be calculated as
The line chart should resemble an umbrella.
I have attached a sample PBIX file for your reference, along with an explanation of what this line chart exactly achieves for your reference.
Sample: Sample Power Bi & Raw Data
Thank you very much
----------------
Current Fail DAX:
Measure =
VAR first_date = CALCULATE(MIN('Data'[Date]),ALLSELECTED('Data'))
VAR last_date = MAX('Data'[Date])
VAR mandate = MAX('Data'[Name])
VAR FilteredTable =
FILTER(
ALL('Data'),
'Data'[Date] <= last_date &&
MONTH('Data'[Date]) = MONTH(last_date) &&
'Data'[Name] = mandate
)
VAR FilteredTable_2 =
FILTER(
ALL('Data'),
'Data'[Date] <= last_date &&
'Data'[Date]> first_date &&
'Data'[Name] = mandate
)
VAR HasData = NOT(ISBLANK(SUMX(FilteredTable, 'Data'[Mothly Return (%)])))
RETURN
IF(HasData,
IF(MIN('Data'[Date])=first_date,100,
100*PRODUCTX(FilteredTable_2,1+[Mothly Return (%)]/100)
)
,BLANK()
)
Solved! Go to Solution.
Then you will need to use a disconnected Calendar table and modify the measure slightly.
Measure =
var md = max('Calendar'[Date])
var mn = max(Master[Name])
var mnd = minx(filter(Data,[Name]=mn),[Date])
return if(edate(mnd,-1)=md,100, 100*productx(filter(allselected(Data),[Name]=mn && [Date]<=md),1+[Mothly Return (%)]/100))
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information or anything not related to the issue or question.
If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
Hi lbendlin
Thanks for looking at the question!
Wondering if the sample has been provided is not enough, or is it not able to be accessed?
Sample: Sample Power Bi & Raw Data
Hi lbendlin,
Sorry for confusing you, the umbrella represents the outcome's look.
We like to have them all start from 100, to analysis and compare the performance of them, and for people easily understand how it is, sometimes, will use Usd 1,000 instead.
Here are some application examples.
Then you will need to use a disconnected Calendar table and modify the measure slightly.
Measure =
var md = max('Calendar'[Date])
var mn = max(Master[Name])
var mnd = minx(filter(Data,[Name]=mn),[Date])
return if(edate(mnd,-1)=md,100, 100*productx(filter(allselected(Data),[Name]=mn && [Date]<=md),1+[Mothly Return (%)]/100))
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
91 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
73 | |
68 |