I have been trying to solve this for quite a while now and can't seem to find the solution on the forums as well. Hopefully some of you have encountered it and know how to solve it:
Goal: Hide measure (i.e., total stacked bar) if total number of answers relating to a question are below a certain number, while still seeing the measure for each legend. Of course it should allow outer slicers and filters to have been applied to the visual.
As you can see, the countAnswersMeasure is different depending on the context, as it is 29 in the tooltip, and 63 "outside". If i do an adjustment to the measure:
countAnswersMeasure = IF(COUNT(Answers[answerValue]) > 19, COUNT(Answers[answerValue]), BLANK())
it will remove those blocks where the count falls below 20 within each legend category, but I want it kept as long as the total is 20 or above. I guess there is a DAX solution, but I can't figure it out. Please help!
I have a table like this, which I need to keep as such to allow for highly dynamic data in forms of handling new type of questions and responses:
I made one sample for your reference. If I misunderstood your requirement, kindly share your excepted result and pbix to me.
1. Create a slicer based onAnswers[answerValue]
2. Create a measure as below.
countAnswersMeasure = IF ( ISFILTERED ( Answers[answerValue] ), COUNT ( Answers[answerValue] ), IF ( COUNT ( Answers[answerValue] ) > 1, COUNT ( Answers[answerValue] ), BLANK () ) )
For more details, please check the pbix as attached.
Hi @v-frfei-msft and thank you for your reply!
Unfortunately it wasn't exactly what I wanted.
I believe I was a bit unclear when I described my problem, so I edited my original message. If you could read that again maybe you will understand. I also created a pbix file to show exactly what I want, I would be very happy if you could look at that!
Please upload your file to onedrive and share the link here.
@v-frfei-msft or anyone else who can help me.
I spent some more time on the problem but I still can't solve it. However I managed to narrow it down a bit:
1. I am using Hierarchy Slicer together with two measures that allows me to have AND logic between the attributes (following this guide)
2. One of these measures that is a 1/0 for each row messes with my attempts to only show the stacked bar plot if the total answers for each question is above a certain value. If I escape the filter context (i.e., the answerValue column as legend) using
countAnswersInQuestionMeasure = CALCULATE( COUNT( Answers[answerValue] ), ALL(Answers[answerValue]))
it also removes the HierarchySlicer Check filter. So I guess I need to remove the legend context while keeping the HierarchySlicer Check filter, but I can't get that to work.
Here is an updated pbix file