Forum Discussion
Hide header row in table visual and set column widths
- 1 year ago
Hi Anon9876 , Thank you for reaching out to the Microsoft Community Forum.
No, Power BI does not currently allow you to force column headers to wrap independently of column width. Header text will only wrap when it exceeds the width of the column and there is no option to manually insert line breaks or enable force wrap behaviour. If the column is wide enough to display the entire header in one line, Power BI will not wrap it, even if wrapping had occurred previously when the column was narrower. The only way to restore wrapping is to reduce the column width until the text naturally wraps again.
If you're committed to using table visuals and want a vertically stacked layout that looks seamless, your current method of disabling auto-size, applying temporary wide number formatting to align columns and using formatting tricks to hide headers remains the only viable option in Power BI today. This approach, as described by alish_b , is valid for static reports where layout precision is essential and interactivity or filtering isn't central.
However, if you're open to restructuring your model for a more maintainable and dynamic report, danextian 's suggestion is the better long-term approach, using a matrix visual with either a disconnected table or calculation groups. This lets you display measures like Current Month and Year-To-Date as row items, eliminates the need for layered visuals or header hacks and aligns better with Power BI's native capabilities for grouping and formatting. It does take some setup, but it’s far more scalable and robust for evolving reporting needs.
Interesting!
First, the metrics don't seem to be dynamic so why not compute them in a disconnected table at refresh time? That will save you a lot of formatting (explained next).
Now into the world of workarounds. You could overlap the two visuals (maybe even rename the field titles of the bottom visual to '<Space>', remember this will mess up the width but that will be fixed next). Then, use the formatting option as below to determine the required length (which you will have to do for every measure/field and that does not stop there you will even have to revert them later)
Then head over to the Column header options for the visual and turn off Options>Auto-size width. This will ensure that the columns don't grow/shrink (messing up the illusion). Now revert the formatting options for the measures/fields to what they were before. ( I use this hack even in normal tables to get a consistent formatting.) That should do the trick (maybe you will have to mess around with the maintain layer order too in cases where the user clicks on the bottom table). But yes, if possible go with the first approach and save yourself from this formatting nightmare.
The formatting of the measures does seem to make it align much better than manually dragging the column edges. This may be a little bit picky, but is it possible to force column headings to wrap? Now that I have widened the columns to fit the reformatted measures, the second column header fits without wrapping, but it would look much better if it was wrapped as in my first screenshot. This is what it looks like now, before reverting the measures to the desired format:
I have layered the visuals as suggested by v-hashadapu to hide the headers of the lower table visual.
- v-hashadapu1 year ago
Community Support
Hi Anon9876 , Thank you for reaching out to the Microsoft Community Forum.
No, Power BI does not currently allow you to force column headers to wrap independently of column width. Header text will only wrap when it exceeds the width of the column and there is no option to manually insert line breaks or enable force wrap behaviour. If the column is wide enough to display the entire header in one line, Power BI will not wrap it, even if wrapping had occurred previously when the column was narrower. The only way to restore wrapping is to reduce the column width until the text naturally wraps again.
If you're committed to using table visuals and want a vertically stacked layout that looks seamless, your current method of disabling auto-size, applying temporary wide number formatting to align columns and using formatting tricks to hide headers remains the only viable option in Power BI today. This approach, as described by alish_b , is valid for static reports where layout precision is essential and interactivity or filtering isn't central.
However, if you're open to restructuring your model for a more maintainable and dynamic report, danextian 's suggestion is the better long-term approach, using a matrix visual with either a disconnected table or calculation groups. This lets you display measures like Current Month and Year-To-Date as row items, eliminates the need for layered visuals or header hacks and aligns better with Power BI's native capabilities for grouping and formatting. It does take some setup, but it’s far more scalable and robust for evolving reporting needs.
- Anon98761 year agoFrequent Visitor
Hi v-hashadapu, Thank you. I don't know about disconnected tables and calculation groups. I will have to look into those later. I have been given the task of developing our annual budget, so don't have the time to work on the Power BI file this week. FYI, I am not using time intelligence. The source data is all calculated in a SQL query, including the variances. In Power BI I have created measures to sum each of the amounts and added DAX measures to calculate the variance percentages.
alish_b suggested the formatting of the measures to get consistent columns widths, which does work. danextian has suggested calculation groups, which would avoid the need to layer visuals (the video is helpful). I will look into that when I get time. You have answered my questions regarding the column headers and wrapping. I would like to accept all 3 as the solution, but the message you have sent and I am replying to now summarises things well, so I will accept that as that as the solution. Thank you to alish_b , danextian and v-hashadapu for your help.