Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi
I have a DAX formula that uses the lastdate availabe depending on what filters the user has in place and looks back 12 months but i need it to ignore any start date filters the user may have placed to always get the full 12 months. Can anyone point me in a direction that could acheive this?
Solved! Go to Solution.
@DominosDave You would need to use ALL to bring all of the dates back into context and then filter from there, something along the lines of:
Full 12 Months =
VAR __MaxDate = MAX('Dates'[Date])
VAR __EOM12M = EOMONTH(__MaxDate, -12)
VAR __MinDate = DATE( YEAR(__EOM12M), MONTH(__EOM12M), 1)
VAR __Table = FILTER( ALL('Table'), [Date] >= __MinDate && [Date] <= __MaxDate )
VAR __Result = SUMX( __Table, [Value])
RETURN
__Result
@DominosDave You would need to use ALL to bring all of the dates back into context and then filter from there, something along the lines of:
Full 12 Months =
VAR __MaxDate = MAX('Dates'[Date])
VAR __EOM12M = EOMONTH(__MaxDate, -12)
VAR __MinDate = DATE( YEAR(__EOM12M), MONTH(__EOM12M), 1)
VAR __Table = FILTER( ALL('Table'), [Date] >= __MinDate && [Date] <= __MaxDate )
VAR __Result = SUMX( __Table, [Value])
RETURN
__Result
Thanks Greg much appreciated!
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
23 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
28 | |
12 | |
10 | |
10 | |
6 |