Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
JBussone
New Member

Display stacked bar chart only if one of the filter metrics has a greater than zero value

I am working building out a report with a stack bar chart and I am attempting to write a dax query to display the data as intended. The Data is from the NHL. I have pulled three columns as metrics into my report(they have whole number values):

1. I_F_highDangerGoals

2. I_F_mediumDangerGoals

3. I_F_lowDangerGoals

Now I am pulling those metrics into a stacked bar chart, but I do not want to show any players who have zero goals for ALL three metrics. If they have a greater than zero value for one of those three metrics, I want to display that player. I have tried multiple different queries and cannot seem to get it right. Thank you for any help you can provide!


1 ACCEPTED SOLUTION
MasonMA
Community Champion
Community Champion

Hello @JBussone 


You may try applying below measure to the visual-level filter on your stacked bar chart and Set ' is =1'. 

IF (
SUM('table'[I_F_highDangerGoals]) +
SUM('table'[I_F_mediumDangerGoals]) +
SUM('table'[I_F_lowDangerGoals]) > 0,
1,
0
)

 

Hope this works:) 

View solution in original post

4 REPLIES 4
MasonMA
Community Champion
Community Champion

Hello @JBussone 


You may try applying below measure to the visual-level filter on your stacked bar chart and Set ' is =1'. 

IF (
SUM('table'[I_F_highDangerGoals]) +
SUM('table'[I_F_mediumDangerGoals]) +
SUM('table'[I_F_lowDangerGoals]) > 0,
1,
0
)

 

Hope this works:) 

@MasonMA I just figured it out! Thank you so much for your help! I hope you have a great rest of your day! 🙂

MasonMA
Community Champion
Community Champion

Happy to see it works! You can also mark this as solution so other people can find it:) 

I am so sorry @Mason ! I am very new to Power BI and it has changed a lot since last time I used it(10 yrs ago). I believe I have the correct format but in dax it is showing that my IF statement syntax is incorrect. I assume I would create this this visual filter and it will be selectable in the Data pane once created; After that I can use it under ""Filters on this visual"?

PlayerGoalsFiltered =
IF (
SUM('skaters'[I_F_highDangerGoals]) +
SUM('skaters'[I_F_mediumDangerGoals]) +
SUM('skaters'[I_F_lowDangerGoals]) > 0,
1,
0
)

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.