Forum Discussion

RJ1993's avatar
RJ1993
Frequent Visitor
5 years ago
Solved

Conditionally (item selected/filtered) show data in clustered chart

Hi everyone,

I have the following question:

  • How can you conditionally show data in a 'clustered colum chart' whenever a certain item is highlighted/filtered?

 

I have the following set-up:

Data

  • A table (Table) with 3 columns: respondentId, Question, Answer (long format)
  • Two measures: checkFiltered and TotalCountConditionally

The table (named 'Table') looks like this:

RespondentIdQuestionAnswer
1A1
1B2
1C3
2A2
2B3
2C1
.........

 

The two measures are calculated as follows:

 

 

 

 

 

CheckFiltered = IF(ISFILTERED('Table'), TRUE(), FALSE())
TotalCountConditionally = 
VAR Data = CALCULATE(COUNTA('Table'[Answer])) 
VAR Check = [CheckFiltered] 
RETURN IF(Check = TRUE(), Data, BLANK()) 

 

 

 

 

 

These measures were perfectly in a table. As soon as I click a specific question (A, B or C), the filtered data gives me the distribution of the answers (e.g., how many times did A get a number 1, a number 2, ...). The same thing whenever I don't select anything.

 

- No item selected: 

 

Item selected:

 

However, when using the data in a chart, the data never gets shown at all. No matter when I select something or not, the clustered chart won't show the data (despite the fact that, whenever I click on 'Show data as table', it does reveal the correct data).

 

My clustered chart is set-up like this:

  • Axis: Answer
  • Values: TotalCountConditionally

     

 

I hope someone can help me out with this.  I've attached the file so people might have a look at it. It only contains dummy data

- PowerBI file: https://easyupload.io/15p2kn

 

Kind regards,

RJ

 

 

 

 

 

 

 

 

 

  • Nathaniel_C's avatar
    Nathaniel_C
    5 years ago

    Hi RJ1993 Steps:
    Click on Format tab, click on Edit Interactions - make sure to turn this off afterwards-select table in upper left, then go down to your graph, and click on the Filter icon in the upper left corner of the graph.  Then it works!
    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πŸ‘are nice too.
    Nathaniel

4 Replies

  • Nathaniel_C's avatar
    Nathaniel_C
    Icon for Community Champion rankCommunity Champion

    Hi RJ1993 , if I understand what you are trying to do:

     


    Let me know if you have any questions.

    If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πŸ‘are nice too.
    Nathaniel

    • Nathaniel_C's avatar
      Nathaniel_C
      Icon for Community Champion rankCommunity Champion

      Hi RJ1993 Steps:
      Click on Format tab, click on Edit Interactions - make sure to turn this off afterwards-select table in upper left, then go down to your graph, and click on the Filter icon in the upper left corner of the graph.  Then it works!
      Let me know if you have any questions.

      If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos πŸ‘are nice too.
      Nathaniel

      • RJ1993's avatar
        RJ1993
        Frequent Visitor

        Hi Nathaniel_C ,

         

        Thanks for the quick response! This works perfectly. 

         

        Kind regards,

        RJ1993