Forum Discussion
Dynamic matrix Visual
- 6 days ago
Hi maurcoll,
I would keep the existing measures fairly simple. The main thing is that you don't apply the Start/End measures directly to the matrix. Instead, use a measure as a visual-level filter.
Also, if the slicer is using the same Date column as the matrix, selecting 10 December will filter the matrix to only 10 December. So ideally, use a separate Calendar table for the slicer and matrix dates.
For example, create these measures:
Show Month 1 =
VAR SelectedDate = MIN('Calendar'[Date])
VAR CurrentDate = MAX('Table'[Date])
VAR StartDate = DATE(YEAR(SelectedDate), MONTH(SelectedDate), 1)
VAR EndDate = EOMONTH(SelectedDate, 0)
RETURN
IF(CurrentDate >= StartDate && CurrentDate <= EndDate, 1, 0)Show Month 2 =
VAR SelectedDate = MIN('Calendar'[Date])
VAR CurrentDate = MAX('Table'[Date])
VAR StartDate = EOMONTH(SelectedDate, 0) + 1
VAR EndDate = EOMONTH(SelectedDate, 1)
RETURN
IF(CurrentDate >= StartDate && CurrentDate <= EndDate, 1, 0)Show Month 3 =
VAR SelectedDate = MIN('Calendar'[Date])
VAR CurrentDate = MAX('Table'[Date])
VAR StartDate = EOMONTH(SelectedDate, 1) + 1
VAR EndDate = EOMONTH(SelectedDate, 2)
RETURN
IF(CurrentDate >= StartDate && CurrentDate <= EndDate, 1, 0)Then put 'Table'[Date] in the Rows of each matrix and add the relevant measure to the visual-level filters:
Matrix 1 → Show Month 1 = 1
Matrix 2 → Show Month 2 = 1
Matrix 3 → Show Month 3 = 1Your existing Total Complete and Total Orders measures can then remain as they are.
So if the slicer is set to 10/12/2026, you would get:
Matrix 1 → December 2026
Matrix 2 → January 2027
Matrix 3 → February 2027The separate Calendar table is important here. It allows the slicer to select 10 December without filtering the fact table down to only that one date, so the matrices can still show all the dates in December, January and February.
Hi maurcoll
You will need to use a disconnected table for the selected period as using a table with an active relationship to the fact table will filter the visible rows only to what's been selected. For example, if you select Dec only Dec becomes visible.
Please see the attached pbix.