Forum Discussion
Newbie_2020
6 years agoFrequent Visitor
How to get a value from another table based on the max date selected in a filter?
Hi everyone, I'm really new to Power BI and need some help. 🙂 Would you be able to help me write a DAX formula to get the YTD Plan based on the max date selected in a date filter? Ex: I have a d...
- 6 years ago
Sure, just change the aggregation:
Month YTD Goal (Measure) = VAR __MaxDate = MAX('Date'[Date]) RETURN SUMX(FILTER(ALL('Table 2'),'Table 2'[Date] = __MaxDate),'Table 2'[YTD Plan])
Greg_Deckler
Community Champion
6 years agoSure, just change the aggregation:
Month YTD Goal (Measure) =
VAR __MaxDate = MAX('Date'[Date])
RETURN
SUMX(FILTER(ALL('Table 2'),'Table 2'[Date] = __MaxDate),'Table 2'[YTD Plan])Newbie_2020
6 years agoFrequent Visitor
Greg_Deckler That worked! Yay! Thank you very much! 😃
I just need to remove the ALL after the FILTER. This is what I used:
Month YTD Goal (Measure) =
VAR __MaxDate = MAX('Date'[Date])
RETURN
SUMX(FILTER(('Table 2'),'Table 2'[Date] = __MaxDate),'Table 2'[YTD Plan])
- Greg_Deckler6 years ago
Community Champion
Awesome! Glad we got there! 🙂