Forum Discussion
deepblue_m45
4 years agoFrequent Visitor
Calculate Sum for Max Date -1
I have a variety of visuals showing trends over various periods and want to create a measure to place in a card visual that will calculate the max date in the visual which I have, below (h/t to AlB f...
- 4 years ago
Hi:
Please see attached file. I added a date table to help it along and did some minor transformations to get the data in order. If your data went thru today, the measures could be slighly different. I hope this helps!
https://drive.google.com/file/d/1Yo8mMLjgKW1grfYdZAUShjmyuWLlyS05/view?usp=sharing
tamerj1
Community Champion
4 years agoHi deepblue_m45
Please try
Max Date =
VAR __latestdate =
MAXX (
ALLSELECTED ( 'Date Hierarchy'[Month Year] ),
'Date Hierarchy'[Month Year]
)
RETURN
CALCULATE (
SUM ( 'DataTable-2020-2022'[Value] ),
FILTER ( 'Date Hierarchy', 'Date Hierarchy'[Month Year] = __latestdate )
)deepblue_m45
4 years agoFrequent Visitor
Thanks for the reply! I plugged this in and it works great for the May date. Is there a way to use this to show the month before that (the April equivalent)?