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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Fiztban
New Member

Remove Blank Columns in Bar Charts when Slicing

I have been building a lovely dashboard and everything in my charts has been performing as expected when it comes to visuals, until I started making this bar chart.

Relations including Date TableRelations including Date Table

I am building a tool to visualise stats from our competitive fighting game scene, and on the player analysis page I am trying to put a bar chart that shows wins and losses for each event a player has attended. I am using my T_Games_MU (MU=matchup) table to drive the data for wins and losses by measures, and then I have a related table via the [EventID] field called the T_Events which has the [Event Name] and [Event Date].

 

 

 

Chart all set up no slicingChart all set up no slicing

 

So far so good, I put my win/loss measures in the Y axis, and T_Events[Event Name] in the X axis and everything looks as it should, add T_Events[Event Date] to the tooltips and sort by that field in the visual in ascending order. Awesome, all my events are in chronological order, I even filter out blanks for [Event Name].

 

Bar Chart for W/L per Event set upBar Chart for W/L per Event set up

 

Now I add a slicer for the T_Games_MU[Player] and select one player and suddenly things don't behave the way I expect. The X axis doesn't exclude columns with empty values now.

 

 

 

This is very unexpected. I had just done an ELO Progression chart that had simply the ELO measure on the Y axis and the X axis, with the same setup excluded events with no data once sliced, see below

 

Scatter Plot with same setup, works fine on X axisScatter Plot with same setup, works fine on X axis

 

Ok so I try to change the bar chart to only have the ELO measure on the Y axis, same thing happens all events are included on the X axis, even those with no data when sliced:

Putting the ELO into the bar chart as the only value doesn't make empty columns go awayPutting the ELO into the bar chart as the only value doesn't make empty columns go away

 

I have tried to influence this behaviour by creating a date table, and used that, my X axis was set to Categorised, and the X axis field did NOT have "Show Items With No Data" ticked. No change all empty columns still show. I have tried multiple filters but they don't seem to affect the X axis.

What is happening? Am I missing something here, or is this just how bar charts work? I can't seem to find a method to make empty columns disappear from the visual when I slice for player like in the scatter plot.

1 REPLY 1
Fiztban
New Member

Ok I worked it out:

When you add multiple measures to the Y-axis, Power BI will plot bars for both measures on the X-axis. This means that if one of your measures returns a non-blank result for a certain category, but the other measure returns a blank, Power BI will still show a bar for that category.

 

It's important to understand that the two measures are calculated independently of each other. If the _M Player Match Wins W-Bracket measure is blank for a certain category but _M Player Match Losses W-Bracket is not, a bar will still be shown for that category. And vice versa.

 

This is expected behavior and there's no direct way to remove these bars in Power BI's bar chart visualization settings. It's also a good practice from a data visualization standpoint to keep these bars, as they help to maintain the consistency and readability of your charts.

 

The solution is to add a tooltip that calculates total matches or games played and set that filter to "<>0"

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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