Forum Discussion

maurcoll's avatar
maurcoll
Icon for Helper IV rankHelper IV
6 days ago
Solved

Dynamic matrix Visual

Hi I need to create 3 single month view matrix tables that change depending on the date selected from a slicer. So the first will be the month of the start of the date selected and the following 2 ...
  • ShahRukhSameer's avatar
    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 = 1

    Your 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 2027

    The 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.