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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Nietzsche
Helper V
Helper V

How to border on first level column header only?

Hello everyone,

 

I have a matrix table like the one below, as you can see, the column have two levels, financial year and quarters.

 

Nietzsche_0-1723702779932.png

 

I would like to put border around the year only so that the reader can easily identify financial year when they read the matrix.

Nietzsche_1-1723702992194.png

 

any help would be great.

 

1 ACCEPTED SOLUTION

Hi @Nietzsche 

You can be a bit sneaky and make the | only appear on the last Quarter. Then using conditional formatting to only format the cells with a | in them.

Measure would be something like this:
. =
IF (
    SELECTEDVALUE ( Sales[SaleDate].[Quarter] ) --For the current quarter
        CALCULATE (
            MAX ( Sales[SaleDate].[Quarter] ), --is it equal to the max quarter
            ALLSELECTED ( Sales[SaleDate].[Quarter], Sales[SaleDate].[QuarterNo] )
        ),
    "|", --if it is return |
    BLANK () --Otherwise blank
)

Then conditionally format this column like this:

SamWiseOwl_0-1723721049957.png

If the cell contains a | return a black background.

Make sure the measure is below your calculation in values.

For the very first column use the grid border

SamWiseOwl_0-1723721324141.png

Hope this helps!


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

View solution in original post

4 REPLIES 4
SamWiseOwl
Super User
Super User

Hi @Nietzsche 

Will the matrix stay in this shape?
If so you could use a line rotated:
Insert -> Shapes _> Line -> Rotation 90

 

It isn't perfect but it is a workaround!

 

Ignore that, check out this genius move at 5:20:
How To Put Thick Borders On Matrix Visualizations In Power BI (youtube.com)

Use a measure that returns a | and format that!


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

hi Sam,

 

Thank you for the reply.

That pipe separate technique is cool but will not work for my situation because I have two column while in the video, he only had one column header.

 

If I add pipe separator on my visual's value box, pipe separator will end up at the end of every quarter. so it end up looking like this

Nietzsche_0-1723711671482.png

 

Hi @Nietzsche 

You can be a bit sneaky and make the | only appear on the last Quarter. Then using conditional formatting to only format the cells with a | in them.

Measure would be something like this:
. =
IF (
    SELECTEDVALUE ( Sales[SaleDate].[Quarter] ) --For the current quarter
        CALCULATE (
            MAX ( Sales[SaleDate].[Quarter] ), --is it equal to the max quarter
            ALLSELECTED ( Sales[SaleDate].[Quarter], Sales[SaleDate].[QuarterNo] )
        ),
    "|", --if it is return |
    BLANK () --Otherwise blank
)

Then conditionally format this column like this:

SamWiseOwl_0-1723721049957.png

If the cell contains a | return a black background.

Make sure the measure is below your calculation in values.

For the very first column use the grid border

SamWiseOwl_0-1723721324141.png

Hope this helps!


If you are happy with this answer please mark as a solution for others to find !

Kudos are always appreciated! Check out our free Power BI video courses.

Hi @SamWiseOwl 
Thank you very much, although there is a empty space after every quarter, this is actually pretty good workaround.

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.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.