Forum Discussion
Finding first date shared by multiple products
- 8 years ago
Thanks for all the help!
These are the formulas I used to reach my desired result.
FirstSharedDate = CALCULATE ( MAXX ( SUMMARIZE ( ALLSELECTED ( AllPerfMnthly[Portfolio] ), [Portfolio], "ABCD", MIN ( AllPerfMnthly[Date] ) ), [ABCD] ), ALLEXCEPT ( AllPerfMnthly, AllPerfMnthly[Portfolio] ) ) InceptionDate = CALCULATE ( FIRSTNONBLANK ( AllPerfMnthly[Date], AllPerfMnthly[Date] ), ALLEXCEPT ( AllPerfMnthly, AllPerfMnthly[Portfolio] ) )
Hi Johnsnowlife,
Try these calculated field formulas
Date of investment. This field is not really required. It is just for your information.
=CALCULATE(MIN(Returns[Date]),ALL('Calendar'))
Date of inititation for return calculation
=MAXX(SUMMARIZE(ALL(Returns),[Fund],"ABCD",MIN(Returns[Date])),[ABCD])
Returns
=CALCULATE(SUM(Returns[Performance]),DATESBETWEEN('Calendar'[Date],[Date of initation for return calculation],MAX('Calendar'[Date])))You may download the file from here.
- Johnsnowlife8 years agoHelper III
That hasn't worked for me.
Try this link for my full dataset with your measures.
If the Portfolios selected are "Equity Fund" and "ALSI" I need to get my begin date to be "2006/06/30".
If I select "Equity Fund" and "ALSI" and "Balanced Fund" I need to get my begin date to be "2013/10/31".
- Ashish_Mathur8 years agoSuper User
Hi Johnsnowlife,
It is working fine. I changed the formula a bit and removed the visual level filters. The file is at the same link.
- Johnsnowlife8 years agoHelper III
I see that it is working by itself. Please look at my latest PBIX file with your measures and my full data. You'll see if created a measure using GroupBy that gets to the same answer too.
If I use your "First Initiation Date" measure in a table by itself (bottom table) I get the correct answer with both our formulas.
But the objective of the formula is to use it in a table (top table) to get the correct start date for the performance figures for the specified month.
Currently, the StartDate formulas don't work if I've specified the latest month in the visual slicer. Or the performance measures don't work if I haven't specified the month on the visual slicer.
I'm not sure which one should be changed.
Thank you for the help so far. I hope this challenge is interesting to you...
- Ashish_Mathur8 years agoSuper User
Hi,
Why should there be 2 dates selection routes - you have dragged dates both to the filter section and are also using it as a slicer. Keep any one of them. Select a date/date range there and then see the result of my formula. If you still face problems, please let me know exactly with which selection do you face a problem.
- Johnsnowlife8 years agoHelper III
Thanks for all the help!
These are the formulas I used to reach my desired result.
FirstSharedDate = CALCULATE ( MAXX ( SUMMARIZE ( ALLSELECTED ( AllPerfMnthly[Portfolio] ), [Portfolio], "ABCD", MIN ( AllPerfMnthly[Date] ) ), [ABCD] ), ALLEXCEPT ( AllPerfMnthly, AllPerfMnthly[Portfolio] ) ) InceptionDate = CALCULATE ( FIRSTNONBLANK ( AllPerfMnthly[Date], AllPerfMnthly[Date] ), ALLEXCEPT ( AllPerfMnthly, AllPerfMnthly[Portfolio] ) )