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
ismrdelj
Regular Visitor

Dynamic colums in a table visual depending on values

I need to display in table visual only columns which doesn't contain null values   - see example below ? How can I achieve this? Thanks for help

 

 Table_data_rows       
Category slicercolumn_categorycolumn_name1column_name2column_name3    
category1category1Cat1_value1Cat1_value2Cat1_value3    
category2category2NULLCat2_value2cat2_value3    
category3category3Cat3_value1NULLNULL    
         
         
when Category1 -selected:Table_visual_display (depending on category selection), dynamic columns depending containing only no-NULL row values
result1column_value1column_value2column_value3     
 cat1_value1cat1_value2Cat1_value3     
         
when Category2 -selected:column_name2column_name3      
result2Cat2_value2cat2_value3      
         
when Category3 -selected:column_name1       
result3Cat3_value1       
1 ACCEPTED SOLUTION
DataNinja777
Super User
Super User

Hi @ismrdelj ,

 

Power BI doesn't support truly dynamic columns in table visuals where columns automatically hide if they contain only nulls. However, you can work around this by unpivoting your data in Power Query. In the Power Query Editor, select your value columns such as column_name1, column_name2, and column_name3, then right-click and choose "Unpivot Columns". This will transform your data into a format with three columns: Category, Column Name, and Column Value, where each row represents one value from the original wide format.

Once this is done, you can create a slicer in your report based on the Category column. Then, create a table visual using Column Name on rows and Column Value on values. To ensure that only non-null values appear, add a visual-level filter on Column Value and set it to "is not blank". This will effectively hide any rows (which correspond to your original columns) that had null values for the selected category.

Here's a simple example of what the unpivoted table will look like:

Category Column Name Column Value
category1 column_name1 Cat1_value1
category1 column_name2 Cat1_value2
category1 column_name3 Cat1_value3
category2 column_name1 null
category2 column_name2 Cat2_value2
category2 column_name3 Cat2_value3
category3 column_name1 Cat3_value1
category3 column_name2 null
category3 column_name3 null

 

This approach will allow your visual to dynamically adjust based on the selected category, effectively hiding columns that would otherwise be fully null.

 

Best regards,

 

 

 

View solution in original post

5 REPLIES 5
v-sgandrathi
Community Support
Community Support

Hi @ismrdelj,

Thank you for your patience, and I’m glad the explanation was helpful!

 

@DataNinja777 You’re absolutely right, Power BI doesn’t natively support dynamic columns that hide automatically based on null values in table visuals. However, a great workaround is using Power Query’s unpivoting feature combined with a slicer and visual-level filtering. This method ensures that any null values are hidden, giving you a cleaner and more dynamic view of your data.

 

Glad I could assist! If this answer helped resolve your issue, please mark it as Accept as Solution and give us Kudos to guide others facing the same concern.

 

Thank you.

 

Hi @ismrdelj 

 

We wanted to follow up since we haven't heard back from you regarding our last response. We hope your issue has been resolved.

If my answer resolved your query, please mark it as "Accept Answer" and give Kudos if it was helpful.

If you need any further assistance, feel free to reach out.

Thank you for being a valued member of the Microsoft Fabric Community Forum!

Hi @ismrdelj ,

  

We wanted to follow up since we haven't heard back from you regarding our last response. We hope your issue has been resolved.

If my answer resolved your query, please mark it as "Accept Answer" and give Kudos if it was helpful.

If you need any further assistance, feel free to reach out.

Thank you for being a valued member of the Microsoft Fabric Community Forum!

Hi @ismrdelj ,

 

May I ask if you have gotten this issue resolved?

If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.

 

Thank you.

DataNinja777
Super User
Super User

Hi @ismrdelj ,

 

Power BI doesn't support truly dynamic columns in table visuals where columns automatically hide if they contain only nulls. However, you can work around this by unpivoting your data in Power Query. In the Power Query Editor, select your value columns such as column_name1, column_name2, and column_name3, then right-click and choose "Unpivot Columns". This will transform your data into a format with three columns: Category, Column Name, and Column Value, where each row represents one value from the original wide format.

Once this is done, you can create a slicer in your report based on the Category column. Then, create a table visual using Column Name on rows and Column Value on values. To ensure that only non-null values appear, add a visual-level filter on Column Value and set it to "is not blank". This will effectively hide any rows (which correspond to your original columns) that had null values for the selected category.

Here's a simple example of what the unpivoted table will look like:

Category Column Name Column Value
category1 column_name1 Cat1_value1
category1 column_name2 Cat1_value2
category1 column_name3 Cat1_value3
category2 column_name1 null
category2 column_name2 Cat2_value2
category2 column_name3 Cat2_value3
category3 column_name1 Cat3_value1
category3 column_name2 null
category3 column_name3 null

 

This approach will allow your visual to dynamically adjust based on the selected category, effectively hiding columns that would otherwise be fully null.

 

Best regards,

 

 

 

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.

Top Solution Authors