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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
alejandroRodri
Frequent Visitor

Avoid representation of bars with empty values in a bar chart

Hi, I am trying to make the following bar chart where the x-axis represents names of people and the y-axis represents the average that each person gets for a series of variables.
The problem is that each person has certain variables that the rest do not have, so if I want to represent all the variables, there will be columns for which the other people do not have data and therefore will occupy unnecessary space.

The dataset I am using and the representation are the following:

alejandroRodri_0-1708962430492.pngalejandroRodri_1-1708962485710.png

 

I am doing all this to be able to use additional information in another of my report pages in which if I place the mouse over the name of one of the persons, it will show me their respective bar chart with their variables as shown below.

alejandroRodri_0-1708962999536.png

 

 

I would appreciate an answer. Best regards.

9 REPLIES 9
_AAndrade
Super User
Super User

Can you share your pbix file to let me check?





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




I will try to explain it to you in other words.

In a first sheet I have represented in a bar chart the average score of a group of people and when passing the mouse over each of these scores I want to show another bar chart where the breakdown of this average score is shown, that is to say, the values from which the average is obtained. The problem comes because there are people that within the breakdown have certain items that other people do not have, then I want to adapt the width of the bar chart of each breakdown to their respective number of items.

I think I gott the idea but without a sample data to try it, I can't help





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




USse this data in .csv to try to visualize the idea that I explained you: First dataset to plot average numbers:

Jugador,Promedio de NOTA AJUSTADA,Promedio de NOTA
Eduardo Garcia,8,8   
Luis Martinez,8,7   
Alvaro Perez,7,7   
Diego Rodriguez,7,7   
Javier Martinez,7,7   
David Diaz,7,7   
Jorge Sanchez,7,7   
Alberto Hernandez,7,7   
Mario Navarro,7,7   
Carlos Lopez,7,7   
Sergio Rodriguez,7,7   
Juan Moreno,7,7   
Alejandro Sanchez,7,7   
Sergio Rama,7,6   
Roberto Perez,7,6   
Pedro Gonzalez,6,6   
Sergio Balenziaga,6,6   
Jose Martinez,6,6   
Manuel Ochoa,6,6   
Miguel Valcarce,6,6   
Jorge Munoz,6,6   
Carlos Retuerta,6,6   
     
     

 

second dataframe to chart each breakdown

NOMBRE JUGADOR,TÁCTICA DEF.,TOMA DE DECISIONES,Promedio de Columna
Eduardo Garcia,8,,    
Luis Martinez,8,,    
Alvaro Perez,7,,    
Diego Rodriguez,7,,    
Javier Martinez,7,,    
David Diaz,7,7,7    
Jorge Sanchez,7,,    
Alberto Hernandez,7,7,7    
Mario Navarro,7,,    
Carlos Lopez,7,6,6    
Sergio Rodriguez,7,6,    
Juan Moreno,7,6,    
Alejandro Sanchez,7,7,8    
Sergio Rama,7,6,    
Roberto Perez,7,7,    
Pedro Gonzalez,6,,    
Sergio Balenziaga,6,,    
Jose Martinez,6,6,    
Manuel Ochoa,6,6,    
Miguel Valcarce,6,6,    
Jorge Munoz,6,6,    
Carlos Retuerta,6,,    

With the cvs you provided, I don't think I understood your idea. I thought you were just using a table of facts to make your graph and that's not what you shared.
So I don't understand the idea. At first glance it seemed easy to solve, but right now I'm lost.





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




_AAndrade
Super User
Super User

Hi,

If you are using a single measure for each bar try this for each measure:
IF( [you measure name] = 0 ||  [you measure name] = "", Blank(),  [you measure name] )





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




that DAX formula creates this error:
DAX comparison operations do not support comparison values of type Integer with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.

Take off this part "||  [you measure name] = "" "





Did I answer your question? Mark my post as a solution! Kudos are welcome.

Proud to be a Super User!




I keep having the same problem. In the image you can see that the column of different color is the one that I have created following your DAX formula for one of the variables that only has one of the people and as you can see, in the other two people still appears the empty space for that column (it is logical because those people have empty values for those columns).

alejandroRodri_0-1708964993152.png

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.