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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Snagalapur
Helper IV
Helper IV

how to add shared column header in matrix

Hi All,

 

Kindly help me create shared column header in matrix. 

 

Snagalapur_0-1732728322091.png

Ex:

Snagalapur_1-1732728400103.png

thank you.

3 REPLIES 3
hnguy71
Super User
Super User

Hi @Snagalapur 

Assuming you have a table similar in structure to this:

hnguy71_0-1732729064106.png


You could put your period and metric fields on the columns field well and expand down:

hnguy71_1-1732729214389.png

Result would look like this:

hnguy71_2-1732729244037.png



Alternatively, you can create a disconnected table very similar to this:

hnguy71_0-1732729421384.png

hnguy71_1-1732729454609.png

And you can create a measure with a switch statement to return the correct value(s):

MyValue = 
// retrieve column metric
VAR _Metric = SELECTEDVALUE(Metric[Metric])
RETURN
// return value for specified metric
CALCULATE(SUM('Table'[Value]), 'Table'[Metric] = _Metric)

 



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

thank you so much for details but my data is in same format as mentioned here, not sure how to handle

Snagalapur_0-1732729939253.png

Snagalapur_1-1732729949197.png

 

 

Hi @Snagalapur ,

You would need to go into PowerQuery do some table transformations to unpivot those columns. You'll likely hearthe phrase: "go long instead of wide" many times throughout your BI journey. 

So if your table structure is like this:

hnguy71_0-1732732646484.png


You would need to select all the columns that doesn't need pivoting like so:

hnguy71_1-1732732697827.png


Then right-click and of those columns and click "unpivot other columns"

hnguy71_2-1732732749518.png


And your result should look similar to this:

hnguy71_3-1732732780972.png

 



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Helpful resources

Announcements
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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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