Forum Discussion
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:
| RespondentId | Question | Answer |
| 1 | A | 1 |
| 1 | B | 2 |
| 1 | C | 3 |
| 2 | A | 2 |
| 2 | B | 3 |
| 2 | C | 1 |
| ... | ... | ... |
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
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
Community 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
Community 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- RJ1993Frequent Visitor