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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Clustered column chart: show only values with data

Hi,

 

I have a clusterd column chart that shows various fields from my data. However, I want to show only the fields that have values in it. Ideally, I'd like the legend to only show what's in the graph. See my example:

cluster column.PNG

 

background:

Each row of data is from a facility providing specific food. Each food item is a seperate column. Values will show null if they facility did not provide that food. See below:

cluster column 2.PNG

 

In a perfect world i would just have the visual show only values greater than 0. Or, if there's a way to filter the legends for only values that are in the graph rather than a monster list of 12 when there's only 4 columns returning data. How do I best achieve this?

 

Thank you!

 

 

 

 

 

 

 
1 ACCEPTED SOLUTION

@Anonymous 

 

I used your sample data and created what you asked for.

 

Here are the steps I did in Query editor.

1. Before automatic type conversion, select the columns other than District,ward,school,month(select green_vegetables till salt - 11 columns ; Make sure the selected columns are in alphabetic datatype)

2. In the ribbon, click Transform->unpivot dropdown->selected columns. After this step, the data will look like below.

image.png

3. Change the value column to decimal number format.

4. Close & Apply

 

Now create a new table as below. (I didn't rename the attribute column in previous step)

image.png

 

Define a relationship between the tables based on Attribute.

Create the visual as below.

image.png

 

 

If it helps, mark it as a solution

Kudos are nice too

 

 

 

 

Connect on LinkedIn

View solution in original post

4 REPLIES 4
VasTg
Memorable Member
Memorable Member

@Anonymous 

 

Modify the filter direction to both/bidirectional in the relationship between the table in screenshot and legend attribute table.

 

Update:

If you do not have a seperate dimention for attribute in legend, create a new table as below and define relationship between the tables. Use the attribute from new table as legend.

 

 

If it helps, mark it as a solution

Kudos are nice too

Connect on LinkedIn
Anonymous
Not applicable

Hi @VasTg ,

 

thank you for the response. 

 

I'm not sure I understand since my legend is not a seperate table, but instead each value in the chart is a seperate column. I'm not sure I can create a new table for my legend and link them. 

 

Here's a sample of what it looks like with the example of the data driving the visual:

 

cluster 3.PNG

 

 

This is the underlying data with each column representing each value in the visual above. As you can see there are 10 fields in the legend but only 4 have values when you sum for each respective column. I'd like to have the legend correspond with the graph. Potentially new records could be any of the 10 potential options. 

 

location Districtlocation Wardlocation School_idMonthgreen_vegetablesfruitsotherbeansmaizesorghumriceOFSPmillet bananasalt
Bunda- UrbanKabasa1094Januarynullnullnullnullnullnullnullnullnullnullnull
ButiamaBuhemba1149Januarynullnullnullnullnullnullnullnullnullnullnull
MusomaBukumi1159January20nullnullnullnullnullnullnullnullnullnull
Bunda DCButimba1033Januarynull20nullnullnullnullnullnullnullnullnull
ButiamaMirwa1133January150.4nullnullnullnullnullnullnullnullnullnull
ButiamaBuhemba1148Januarynullnullnullnullnullnullnullnullnullnullnull
ButiamaBuhemba1151Januarynullnullnullnullnullnullnullnullnullnullnull
ButiamaBuhemba1152Januarynullnullnullnullnullnullnullnullnullnullnull
ButiamaBuhemba1150Januarynullnullnull85nullnullnullnullnullnullnull
ButiamaMirwa1134Januarynullnullnullnullnullnullnullnullnullnullnull
ButiamaMirwa1132January330nullnullnullnullnullnullnullnullnullnull
ButiamaMasaba1143January50nullnullnullnullnullnull121nullnullnull
ButiamaMasaba1145Januarynullnullnullnullnullnullnullnullnullnullnull
ButiamaMasaba1146Januarynullnullnullnullnullnullnullnullnullnullnull
ButiamaMasaba1147Januarynullnullnullnullnullnullnullnullnullnullnull
ButiamaBuruma1128Januarynullnullnullnullnullnullnullnullnullnullnull
ButiamaBuruma1130January20nullnullnullnullnullnullnullnullnullnull
ButiamaBuruma1129Januarynullnullnullnullnullnullnullnullnullnullnull

 

thank you and hope my explanation makes sense. Thanks for taking the time to help.

 

 

 

@Anonymous 

 

I used your sample data and created what you asked for.

 

Here are the steps I did in Query editor.

1. Before automatic type conversion, select the columns other than District,ward,school,month(select green_vegetables till salt - 11 columns ; Make sure the selected columns are in alphabetic datatype)

2. In the ribbon, click Transform->unpivot dropdown->selected columns. After this step, the data will look like below.

image.png

3. Change the value column to decimal number format.

4. Close & Apply

 

Now create a new table as below. (I didn't rename the attribute column in previous step)

image.png

 

Define a relationship between the tables based on Attribute.

Create the visual as below.

image.png

 

 

If it helps, mark it as a solution

Kudos are nice too

 

 

 

 

Connect on LinkedIn
Anonymous
Not applicable

Hi @VasTg 

 

Thank you!!! That solution worked for me!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors