Forum Discussion
Cookie_Lover
Helper I
8 months agoFilter bar chart depending on field parameters and hide bars when there are no comparison values
Hello, I have the following problem: I have created index values based on the Value column. Blue is assigned an index of 100 for each product. The other colors (red, green, and yellow) are th...
Thomaslleblanc
Super User
7 months agoChange your measures so they blank themselves out when data is not present, and make
DIVIDE’s alternate result BLANK() (not 0). Then the bar disappears automatically.
// Reuse your existing helpers
Blue filtered for Comparison :=
CALCULATE( AVERAGE( Table1[Value] ), Table1[Color] = "blue" )
// Return BLANK when either side is missing
Blue as index for comparison :=
VAR Blue = [Blue filtered for Comparison]
RETURN IF( NOT ISBLANK(Blue), 100 )
repeat for the others
Now, when your field parameter switches between Green/Red/Yellow, any Product lacking that color (or lacking Blue) returns BLANK(), so the bar is hidden.
Cookie_Lover
Helper I
7 months agoThis does not work for me. The result is the same as before.