Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

Problem With Slicers And Matrices

I'm trying to setup a page with two matrix visuals and two slicers.  First, the two slicers looks like this:

smichels_0-1666201493572.png

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

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

Here's my solution.

1.Create a seperate calendar table for the two slicer.

vstephenmsft_0-1666257552665.png

vstephenmsft_2-1666257633564.png

 

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)

vstephenmsft_3-1666257661628.png

 

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])))

vstephenmsft_4-1666257732159.png

 

 

 

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.

 

Anonymous
Not applicable

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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.