Forum Discussion

MinCK's avatar
MinCK
Frequent Visitor
1 year ago
Solved

Connect table chart and line chart

Hi Folks!

 

I need help on creating interaction between two graphs in a dashboard. In my example, I have measures on tables chart. I would like my user to be able to filter the measures in the below line chart to see only the measure trend accordingly. For example, if they want to see the measure A trend, click on the column name on table chart, then the line chart would remove other measures out and show only the trend of measure A.

Currently what it allows me to do is selecting the company (rows) and then it will filter the line graph but it still show all measures.

 

Thank you in advance!

 

  • Hi MinCK 

    To enable filtering between visualizations, there must be a filter context that connects them.
    Since measures cannot act as filters, this connection must be established through a column.

    If your table visual displays measures as separate columns and your line chart also uses multiple measures, you will need to create a disconnected table that lists all the measure names.

    Then, by implementing a dynamic measure, you can detect the selected measure and adjust the line chart to display only its trend.

    For example, if I have the measures like on the picture :

     

    I will create a disconnected table :

    And dynamic measure that will operate with the selections from table and graph :

    visual_dynamic_measure =
    var selected_ = SELECTEDVALUE('measures for context demo'[measure])
    RETURN
    SWITCH(selected_,
    "a", [Total sales (K/$)],
    "b", [total profits (K/$)],blank())
    Then I will use the column of my created table as a column ( not value ) in the matrix and as a legend on the graph:

    the dynamic measure will act as a "values" on table, and "Y-axis" on the graph :

    Result :

    The pbix is attached

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

1 Reply

  • Hi MinCK 

    To enable filtering between visualizations, there must be a filter context that connects them.
    Since measures cannot act as filters, this connection must be established through a column.

    If your table visual displays measures as separate columns and your line chart also uses multiple measures, you will need to create a disconnected table that lists all the measure names.

    Then, by implementing a dynamic measure, you can detect the selected measure and adjust the line chart to display only its trend.

    For example, if I have the measures like on the picture :

     

    I will create a disconnected table :

    And dynamic measure that will operate with the selections from table and graph :

    visual_dynamic_measure =
    var selected_ = SELECTEDVALUE('measures for context demo'[measure])
    RETURN
    SWITCH(selected_,
    "a", [Total sales (K/$)],
    "b", [total profits (K/$)],blank())
    Then I will use the column of my created table as a column ( not value ) in the matrix and as a legend on the graph:

    the dynamic measure will act as a "values" on table, and "Y-axis" on the graph :

    Result :

    The pbix is attached

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.