Forum Discussion
hide second column in matrix
- 1 year ago
Hi micdwo ,
To hide the Column2 Display in the matrix only for specific Subname values (e.g., when Subname "not equal to" Subname3), Power BI doesn’t support dynamic column removal. However here are few workarounds that will help:
Use a measure that returns BLANK() when Subname "not equal to" Subname3 to hide values.Apply conditional formatting to make the column appear invisible (e.g., white font/background).Use slicers or bookmarks to toggle matrix visuals based on Subname.Create separate matrix visuals for different Subname values if needed.
Thank you.
Hi micdwo ,
Here’s what works best:
1. Easiest fix: Go to your matrix’s Format pane, find the “Values” section, and turn OFF “Show items with no data.”
This usually hides any columns (or subname columns) that are completely blank.
2. If you still see empty columns: Sometimes columns look blank but actually have zeros, spaces, or “nulls” that Power BI doesn’t treat as blank. Try putting your Subname field into the Visual Filters and set it to exclude blanks or filter just the subnames you want to see.
3. DAX measure for even more control: If you want to be 100% sure columns are hidden when there’s nothing to show, you can use a custom measure like:
Show Column =
IF(
ISBLANK([Column 1]) && ISBLANK([Column 2]),
BLANK(),
[Column 1] // or whichever value makes sense for your setup
)
Power BI will automatically hide columns that only return BLANK. If you want to only show a specific subname (like Subname3), you can use a measure like:
Show Subname3 Only =
IF(
SELECTEDVALUE([Subname]) = "Subname3",
[Your Value Measure]
)
Turn off “Show items with no data” first it solves most cases. Use BLANK()-based DAX if you want to get fancy or the basics don’t work.