Forum Discussion
3 different formulas with same outcome....why?
- 3 years ago
rpinxt Try this:
Measure = VAR __Date = MAX(Dim_Date[Date]) VAR __Year = MAX('Dim_Date'[Year]) VAR __Table = SUMMARIZE( FILTER( ALL('Dim_Date'), [Date] <= __Date && [Year] = __Year ), [Period], "__Prod_ACT",[Prod_ACT] ) RETURN AVERAGEX(__Table,[__Prod_ACT])
Greg_Deckler I understand Greg. Made a simpler new model for myself to check the logics but there they work.....
It is a rather complicated (for me) model but I put in on Google Drive for you to have a look at.
Saw that that was also a possibility to share my file with you so here is the link:
https://drive.google.com/file/d/1vQAq2eifdjwul0bE6Un7OPQmfDvPpKd2/view?usp=sharing
And what I try to achieve is actually what is in the green column below :
rpinxt Try this:
Measure =
VAR __Date = MAX(Dim_Date[Date])
VAR __Year = MAX('Dim_Date'[Year])
VAR __Table =
SUMMARIZE(
FILTER(
ALL('Dim_Date'),
[Date] <= __Date && [Year] = __Year
),
[Period],
"__Prod_ACT",[Prod_ACT]
)
RETURN
AVERAGEX(__Table,[__Prod_ACT])- rpinxt3 years ago
Solution Sage
Greg_Deckler amazing....spot on 😁👍
Code looks not straight forward...what would be the bottleneck in my model causing all these troubles (because with standard formulas it would not work)?
Also just for my knowledge could it also return the YTD amount?
Probably it is there somewhere in the logic.
- Greg_Deckler3 years ago
Community Champion
rpinxt Should be to just use the same code and do a SUMX instead of an AVERAGEX.
- rpinxt3 years ago
Solution Sage
Thanks! Learned a lot todayy 😁