Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Display previous months on the X axis

Hi Team,

In continuation with post Solved: Re: Display 6 months on the X axis - Microsoft Fabric Community , I have achieved the requirement as suggested by danextian .

However, on the same page there is another table/matrix visual which is not geting filtered by months slicer, because of disconnected table.

I have attached the sample pbix  here  , where you can see that the bar chart is working well as per the selected slicers, however the botton visual is not being filtered.

Any help would be appreciated.

  • danextian's avatar
    danextian
    1 year ago

    You can create another measure to establish a virtual relationship between the disconnected table and the related dates table using TREATAS.

    Agg selected month =
    CALCULATE (
        [Sum of Value],
        -- Applies the [Sum of Value] measure within the specified filter context.
        KEEPFILTERS (
            -- Ensures existing filters on the DatesTable remain in place while applying the TREATAS filter.
            TREATAS (
                VALUES ( DisconnectedDatesTable[Month and Year] ),
                -- Retrieves unique values from the DisconnectedDatesTable[Month and Year].
                DatesTable[Month and Year] -- Maps the values from the disconnected table to the active DatesTable[Month and Year] column.
            )
        )
    )
    

     

     

8 Replies

  • Hi Anonymous 

     

    As disconnected tables cannot directly filter another table other than through measures, you either create a new measure or use the exisiting measure referencing the disconnected table as a visual filter.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      danextian Thanks mate for the alternate solution, however in the matrix below, only the selected month from the slicer should be filtered and not the previous months.

      • danextian's avatar
        danextian
        Icon for Super User rankSuper User

        You can create another measure to establish a virtual relationship between the disconnected table and the related dates table using TREATAS.

        Agg selected month =
        CALCULATE (
            [Sum of Value],
            -- Applies the [Sum of Value] measure within the specified filter context.
            KEEPFILTERS (
                -- Ensures existing filters on the DatesTable remain in place while applying the TREATAS filter.
                TREATAS (
                    VALUES ( DisconnectedDatesTable[Month and Year] ),
                    -- Retrieves unique values from the DisconnectedDatesTable[Month and Year].
                    DatesTable[Month and Year] -- Maps the values from the disconnected table to the active DatesTable[Month and Year] column.
                )
            )
        )
        

         

         

  • Hi Anonymous ,

    Do you want to display in the Matrix the values only for selected month and year?
    Please give me more details and context.

    • Anonymous's avatar
      Anonymous
      Not applicable

      That's right Bibiano_Geraldo 

      The way months are being filtered in the bar chart, it should show the same in the matrix.

  • Anonymous's avatar
    Anonymous
    Not applicable

    danextian Truly a champ and genious. Appreciated.