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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
alinamarinbadea
Frequent Visitor

Create matrix with multiple column header levels

Hello, all! 

In PBI I have the following Tables:

 

Table1

Product numberNet weightWeight unit
A15G
B20KG

 

Table2

Product numberPackaging unitLength WidthHeightDimension unit
APiece152015mm
ABox----
APallet52520cm
BPiece205421mm
BBox524120cm
BPallet----

 

First question: is there a way to include the dimension unit into Lenght, Width and Height cells? So that Table2 would look like:

Product numberPackaging unitLength WidthHeight
APiece15 mm20 mm15 mm
ABox---
APallet5 cm25 cm20 cm
BPiece20 mm54 mm21 mm
BBox52 cm41 cm20 cm
BPallet---

 

Second question: I want to create a visual that would look like this:

 

Product NumberNet weightPiece  Box  Pallet  
  Length WidthHeightLength WidthHeightLength WidthHeight
A15 G15 mm20 mm15 mm---5 cm25 cm20 cm
B20 KG20 mm54 mm21 mm52 cm41 cm20 cm--

-

 

 

After extensive research here, I was able to create a matrix showing the Units of measure but I don't know how to display the Net weight. If I add the net weight to the Values, it displays the Net weight for all units of measure, even though the net weight refers to the Piece unit of measure. 

 

Thank you in advance for your help!

1 ACCEPTED SOLUTION
v-nuoc-msft
Community Support
Community Support

Hi @alinamarinbadea 

 

For the first problem, if you want to join two fields, you can try the following:

 

Create columns,

 

 

Column _length = [Length ] & " " & [Dimension unit]

 

 

Column _width = [Width] & " " & [Dimension unit]

 

 

Column _height = [Height] & " " & [Dimension unit]

 

 

vnuocmsft_0-1709864332578.png

 

Or create measures,

 

 

_length = SELECTEDVALUE('Table 2'[Length ]) & " " & SELECTEDVALUE('Table 2'[Dimension unit])

 

 

_width = SELECTEDVALUE('Table 2'[Width]) & " " & SELECTEDVALUE('Table 2'[Dimension unit])

 

 

_height = SELECTEDVALUE('Table 2'[Height]) & " " & SELECTEDVALUE('Table 2'[Dimension unit]) 

 

 

vnuocmsft_1-1709864457966.png

 

For the second question, as you said, you can create a matrix.

 

Note, however. table 1 is a table with a hierarchical structure. you may not be able to get a parallel structure using a matrix. It should look like this:

 

vnuocmsft_2-1709865022982.png

Next, you can put the Packaging unit field of table 2 into "Columns" and the measures you just created into "Values".

 

vnuocmsft_4-1709865252916.png

 

Here is the result.

 

vnuocmsft_5-1709865277695.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

1 REPLY 1
v-nuoc-msft
Community Support
Community Support

Hi @alinamarinbadea 

 

For the first problem, if you want to join two fields, you can try the following:

 

Create columns,

 

 

Column _length = [Length ] & " " & [Dimension unit]

 

 

Column _width = [Width] & " " & [Dimension unit]

 

 

Column _height = [Height] & " " & [Dimension unit]

 

 

vnuocmsft_0-1709864332578.png

 

Or create measures,

 

 

_length = SELECTEDVALUE('Table 2'[Length ]) & " " & SELECTEDVALUE('Table 2'[Dimension unit])

 

 

_width = SELECTEDVALUE('Table 2'[Width]) & " " & SELECTEDVALUE('Table 2'[Dimension unit])

 

 

_height = SELECTEDVALUE('Table 2'[Height]) & " " & SELECTEDVALUE('Table 2'[Dimension unit]) 

 

 

vnuocmsft_1-1709864457966.png

 

For the second question, as you said, you can create a matrix.

 

Note, however. table 1 is a table with a hierarchical structure. you may not be able to get a parallel structure using a matrix. It should look like this:

 

vnuocmsft_2-1709865022982.png

Next, you can put the Packaging unit field of table 2 into "Columns" and the measures you just created into "Values".

 

vnuocmsft_4-1709865252916.png

 

Here is the result.

 

vnuocmsft_5-1709865277695.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.