Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to calculate the YTD for every given year, as seen in the table.
I have the following formula for the max year. Does anybody have an idea how to adapt the formula so the YTD is calculated individualy for every single year. If possible I would like a formel that can be used for the whole table instead of having a formula for each year
=Num((Sum({<Valuationdate={"$(vYearEnd)"}>}[Adjusted NAV])-Sum({<Valuationdate={"$(vYearStart)"}>}[Adjusted NAV]))/Sum({<Valuationdate={"$(vYearStart)"}>}[Adjusted NAV]),'##,##%')
Der Tipp war super!! Es klappt wenn ich =YTD auf einem Textfeld eingebe, dann kommt auch das richtige Ergebnis aber sobald ich es in die Tabelle packe ist das Ergebnis falsch.
Ich habe das so in mein Skript geladen:
So sah die Formel aus:
& das Ergebnis so:
Das YTD sollte aber für 2023 Bspw. 3,41% sein. Hatte schon ein wenig rumprobiert aber konnte das Ergebnis nicht erreichen.
Hast du vielleicht eine Idee woran es liegen könnte?
Lass erstmal das num() weg, um eventuelle Fehl-Formatierungen auszuschließen. Dann erstelle noch weitere parallele Formeln, mit avg() + count() sowohl mit dem Flag in der Set Analysis, als auch ohne - und in einem Folgeschritt nimm auch mal ein/zwei weitere Dimensionen dazu, wie die Fund-Felder. Werden wirklich die erwarteten Werte angezeigt?
Wenn ich mir die Formel so anschaue ist deine Berechnung einfach eine andere. In deiner ursprünglichen Berechnung hast du ja die prozentuale Steigerung der [Adjusted NAV] im Vergleich zum Jahresanfang berechnet, aktuell summierst du alle [Adjusted NAV] Werte, für die YTD=1 gilt.
Da muss also deine Formel entsprechend angepasst werden.
Still searching for the right answer
Ich denke, es gibt hier tiefergehende Herausforderungen mit den Daten und/oder Datenmodell und/oder den entsprechenden Ableitungen. Lass die YTD Bedingung und alle Formatierungen erstmal raus und nimm nur sum/avg/count des Feldes + die Quoten-Berechnung - gegen das Jahr sowie auch ein/zwei granularere Dimensionen. Werden hier jetzt die erwarteten Ergebnisse abgebildet?
Hallo @EL_MAR ,
Wie schon in meiner vorherigen Antwort geschrieben solltest du dir nochmal deine Formel anschauen, da diese aktuell von der in deinem ursprünglichen Post abweicht.
=Num((Sum({<Valuationdate={"$(vYearEnd)"}>}[Adjusted NAV])-Sum({<Valuationdate={"$(vYearStart)"}>}[Adjusted NAV]))/Sum({<Valuationdate={"$(vYearStart)"}>}[Adjusted NAV]),'##,##%')
vs
=Num((Sum({<YTD={1}>}[Adjusted NAV]),'##,##%')
Deine neue Formel bildet also nur den rot markierten Teil aus der alten Formel ab.
Anhand deines Skripts würde ich also folgende Formel vorschlagen:
=Num(
(Sum({<YTD={1}>}[Adjusted NAV])
-Sum({<DayNumber={1}>}[Adjusted NAV]))
/Sum({<DayNumber={1}>}[Adjusted NAV]),'##,##%')
Eventuell musst du auch die Bedingung für YTD = 1 anpassen, da gemäß deiner alten Formel ja nur über solche Werte eine Summe gebildet wird, für die Valuationdate = max(Valuationdate) gilt.
I created a quick fix which is working for me. The thing that was weirding out the table was the dimension, because trough the dimension Year that I had and the years in the formula their interacted with oneanother. To eliminate that I left out the dimension and created the formula for YTD:
=Num(
(Sum({<Valuationdate = {"$(=Date(Max({<Year={2024}>} Valuationdate)))"}>} [Adjusted NAV])
- Sum({<Valuationdate = {"$(=Date(Min({<Year={2024}>} Valuationdate)))"}>} [Adjusted NAV]))
/
Sum({<Valuationdate = {"$(=Date(Min({<Year={2024}>} Valuationdate)))"}>} [Adjusted NAV])
, '##,##%')
In the tab Presentation I have the title 2024, as written in the example. I did that for each year and got the following table:
The next Problem was to have the Ultimo Date (last working date of the month) to calculate the correct YTD. I did that in the script that filtered for Ultimo 1, so if it is Ultimo it produces a 1. With that I implemented a filter, so that just the ultimo dates are calculated. If not activated it calculates the YTD from the Min Date to the overall Max Date.