Forum Discussion
YTD for calculated values not working
- 2 years ago
superjam Here you go:
Measure = VAR __MesAnoNUm = MAX('Calendar'[MesAñoNum]) VAR __Table = FILTER ( SUMMARIZE( ALLSELECTED('Calendar'), [MesAño], [MesAñoNum], "__Value", [Revenue month] ), [MesAñoNum] <= __MesAnoNum ) VAR __Result = SUMX( __Table, [__Value] ) RETURN __Result
Thank you so much, Greg_Deckler .
I copied your YTD formula and only adapted it to match table and field names in my database. Unfortunaltely it did not work. I must have something different in my data logic!
In your pbix I see everything like explained.
¿How can I upload a pbix file?
Thanks and regards
Hello, Greg_Deckler , mickey64 , Ashish_Mathur
Here is an extract of my project:
Thank you again and regards,
- Greg_Deckler2 years agoCommunity Champion
superjam Here you go:
Measure = VAR __MesAnoNUm = MAX('Calendar'[MesAñoNum]) VAR __Table = FILTER ( SUMMARIZE( ALLSELECTED('Calendar'), [MesAño], [MesAñoNum], "__Value", [Revenue month] ), [MesAñoNum] <= __MesAnoNum ) VAR __Result = SUMX( __Table, [__Value] ) RETURN __Result- superjam2 years agoHelper II
Hello Greg_Deckler
You rock!! It worked fine. THANK YOU very much.
Now it is my turn to discover and learn how you did it (and why otherwise it did not work).
And I think I will by your book. Really.
Kind regards.
- Greg_Deckler2 years agoCommunity Champion
superjam Thanks. It's interesting because at it's heart, it's a running total. And you have a Calendar table so, in theory, you should have been able to construct that running total using CALULATE and/or using time intelligence functions so not entirely certain where things were going haywire other than it's likely some complexity buried in your measures that eventually become part of the running total. A lot of running totals are simple SUM's but yours is much more complex so that would be my guess as far as what was going on.