Forum Discussion

Wresen's avatar
Wresen
Post Patron
4 months ago
Solved

Filter Graph only by one column from a table

Hi and thx for reading this  I have a table and a graph as picture below. I would like to be able to click on the table and the graph will show the values in for the Item i have click, (Red or Bl...
  • johnt75's avatar
    johnt75
    4 months ago

    To get the behaviour you're after we need to get a bit more intricate. First, you'll need a separate table to use on the axis of the chart. You could create a proper date table or you could keep it as simple as using

    Month Table = DISTINCT( 'Table'[Month] )

    Use the month table on the graph but keep using the 'Table'[Month] column in the table visual.

    Create a relationship from 'Month Table'[Month] to 'Table'[Month].

    Turn on Edit Interactions and change the behaviour so that your table visual filters the graph instead of cross highlighting it.

    Finally, change the measure to be

    Num rows by item = CALCULATE( 
        SUM ( 'Table'[sum] ),
        REMOVEFILTERS( 'Table'[Month] ),
        VALUES( 'Month Table'[Month] )
    )