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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
Solution Sage
Solution Sage

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
Solution Sage
Solution Sage

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! 🙂

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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