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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Theeshk93
Frequent Visitor

Need Help on a table

Hi,

It will be much appreaciated if someone can help in the below query please.

Problem - I'm creating a table with the names of managers and the departments they are incharge of. My source table consists of Columns with Manager and Department. I need a visual which show the managers and their department. Some departments can fall under 2 or more managers. My challenge is removing the blank space (rows) in the table visual above the deparments. I have attached an example below. I want the blank space above John and Louis removed and the departments moved to start from the first row of the table. In my original table in Power Query, it is blank as well.  Thanks in advance.

BenJohnLouis
IT  
Finance  
 Womens 
 Procument 
  Sales
  Finance
1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @Theeshk93 

 

In the query editor, you can unpivot all columns and then remove blank rows from the resulting value column and then add an index or order column for each unique department per manager either with DAX or M. You can use this order column to create a kind of invisible key so provide a row context for each department per manager so all

danextian_0-1749981163322.png

danextian_1-1749981251302.png

danextian_2-1749981349870.png

Please refer to the attached pbix for the details.

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

5 REPLIES 5
v-sgandrathi
Community Support
Community Support

Hi @Theeshk93,

 

Hi,

I wanted to check in your situation regarding the issue. Have you resolved it? If you have, please consider marking the reply as Accepted solution and give Kudos that helped you. It would be greatly appreciated by others in the community who may have the same question.

 

Thann you,
Sahasra.

Hi Sahasra, 

My problem is not solved yet, I have responded above.TIA

SundarRaj
Super User
Super User

Hi @Theeshk93, here's another solution. Thanks

SundarRaj_1-1749984846410.png

M Code used:

( The Table used here that is the Source is the above table mentioned above by you )

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WckrNU9JR8srPAFE++aWZxUqxOtFKniFArgIYg7humXmJecmpKGIgVnh+bmpeMYpQQFF+cilQtARFFISDE3NSi1FEYMbGxgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}, {"Column3", type text}}),
List = List.Transform ( Table.ToColumns ( #"Changed Type" ) , each List.Select ( _ , each not ( _ = " " ) ) ),
Table = Table.PromoteHeaders ( Table.FromColumns ( List ) )
in
Table

 

Sundar Rajagopalan
danextian
Super User
Super User

Hi @Theeshk93 

 

In the query editor, you can unpivot all columns and then remove blank rows from the resulting value column and then add an index or order column for each unique department per manager either with DAX or M. You can use this order column to create a kind of invisible key so provide a row context for each department per manager so all

danextian_0-1749981163322.png

danextian_1-1749981251302.png

danextian_2-1749981349870.png

Please refer to the attached pbix for the details.

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Nasif_Azam
Super User
Super User

Hey @Theeshk93 ,

Thanks for sharing the screenshot and your problem context. You're trying to create a matrix-style table visual in Power BI (or similar), where each manager’s name is a column header and their departments are listed below but you're seeing blank rows above the departments, especially under John and Louis.

Solutions

Option 1: Create Separate Tables for Each Manager

To avoid blank rows:

  1. Use measures or calculated tables to filter the departments per manager:

    Ben_Departments = 
    FILTER('DepartmentTable', 'DepartmentTable'[Manager] = "Ben")
  2. Then create a table visual per manager or concatenate them using UNION and add a [Manager] column to make one clean table.

Option 2: Create a Custom Table Visual

If you want a side-by-side table like your image:

  • Create this shape manually in Power BI using:

    FinalDisplayTable =
    DATATABLE(
      "Ben", STRING,
      "John", STRING,
      "Louis", STRING,
      {
        {"IT",      BLANK(), BLANK()},
        {"Finance", BLANK(), BLANK()},
        {BLANK(),  "Womens", BLANK()},
        {BLANK(),  "Procurement", BLANK()},
        {BLANK(),  BLANK(), "Sales"},
        {BLANK(),  BLANK(), "Finance"}
      }
    )

You can build this DATATABLE using Power Query transformations as well, such as pivoting and filling blank rows upward.

 

For Detailed Information:

 

Microsoft Docs – Matrix Visual

Power Query Fill Down Docs

Radacad Tutorial

 

If you found this solution helpful, please consider accepting it and giving it a kudos (Like) it’s greatly appreciated and helps others find the solution more easily.


Best Regards,
Nasif Azam



Did I answer your question?
If so, mark my post as a solution!
Also consider helping someone else in the forums!

Proud to be a Super User!


LinkedIn

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.