March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I'm trying to setup a page with two matrix visuals and two slicers. First, the two slicers looks like this:
This will allow the user to select the year and the month. One matrix is already setup to work with this so it only displays data for the selected month/year and it works great. The second matrix needs to display year-to-date data from the beginning of the selected year through the end of the selected month/year. I have a measure for getting the user-selected date and its last day and one for getting the date of January first of the selected year. What I'm unable to do, so far, is figure out how to set a date range filter for the matrix. Can this be done?
Thanks in advance!
Scott
Hi @Anonymous ,
Here's my solution.
1.Create a seperate calendar table for the two slicer.
2.Create a mesaure to filter for the first visual. Put the measure into filters and set up show items when the value is 1.
visual-level-filter = var _date=MAX('Table'[Date])
return IF(MONTH(_date)<=SELECTEDVALUE('Table 2'[Date].[MonthNo])&&YEAR(_date)=SELECTEDVALUE('Table 2'[Date].[Year]),1)
3.Create another measure to get the year to date value.
YTD = CALCULATE(SUM('Table'[Value]),FILTER(ALLSELECTED('Table'),MONTH([Date])<=SELECTEDVALUE('Table 2'[Date].[MonthNo])&&YEAR([Date])=SELECTEDVALUE('Table 2'[Date].[Year])))
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Stephen,
I tried your solution but, unfortunately, I couldn't get it to work. It caused the first matrix that was working to no longer work and I couldn't get the second matrix to work at all.
I appreciate the time and effort.
Scott
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
119 | |
88 | |
73 | |
67 | |
49 |
User | Count |
---|---|
199 | |
141 | |
97 | |
79 | |
68 |