Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I also have a second visual - a matrix, which shows data for the previous EndOfMonth.
For example, if the user selects December 2024, the first visual would show data for every day of this month. The second matrix should show data for November 30th 2024 (previous end of month).
The filter works for the first visual but how can I retrieve the user's selected date to calculate the date for the second visual?
Solved! Go to Solution.
Thank you johnt75
Hi, @SonyaNadesan
Based on your description, I've created the following measure:
Measure = CALCULATE(SUM('Table'[Value]),DATEADD('DateTable'[Date],-1,MONTH))
Use it to create a visual as follows:
The results are as follows:
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you johnt75
Hi, @SonyaNadesan
Based on your description, I've created the following measure:
Measure = CALCULATE(SUM('Table'[Value]),DATEADD('DateTable'[Date],-1,MONTH))
Use it to create a visual as follows:
The results are as follows:
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for your response!
However, I can't drop a measure into the columns section of the matrix. Any ideas why?
I think the simplest way would be to create a calculation group with a calculation item using the below DAX.
Prev End of Month =
VAR ReferenceDate =
    MAX ( 'Date'[Date] )
VAR PrevEndOfMonth =
    EOMONTH ( ReferenceDate, -1 )
VAR Result =
    CALCULATE ( SELECTEDMEASURE (), TREATAS ( { PrevEndOfMonth }, 'Date'[Date] ) )
RETURN
    Result
Apply the calculation group as a filter on the second matrix, and select the calculation item. This will then calculate any measure you put into the matrix as at the end of the previous month.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.