Forum Discussion
Getting Prevous Month Value Based on Max Date
- 6 years ago
Hi Anonymous ,
You may create formula like DAX below.
Column: Max Date = IF(MAX('My Place Data'[Reporting Date])=EOMONTH(TODAY(),-1),EOMONTH('My Place Data'[Reporting Date],-1),EOMONTH(TODAY(),-1)) Measure: PM_Value = CALCULATE(SUM('My Place Data'[Values]),FILTER('My Place Data','My Place Data'[Reporting Date]=MAX('My Place Data'[Max Date])))Result:
Best Regards,
Amy
Community Support Team _ Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous got that, so now what? What you want to achieve?
parry2k I want to write a measure that will give me the value for second max date in my data set ignoring if I have any date that is not end of the month.
so for both tables Max date is 30/11/2019 and second max date is 31/10/2019. The the value at second latest date is 300 (the value that I want to get.)
I wrote following dax measure to get the max date of my dataset:
and following one to get the value for Max second date
- parry2k6 years agoSuper User
Anonymous your following statement is confusing
so for both tables Max date is 30/11/2019 and second max date is 31/10/2019.
for Dataset 1 , max date is 18/12/2019 instead of 30/11/2019, am I missing something here?
- Anonymous6 years agoNot applicable
parry2k I only build my reports once the month is closed. So for this purpose, my max date should be 30 Nov, once we have closed December My max date will be 31st December. hope that makes sense.