cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
Iheb_Ghali
Frequent Visitor

Create column above columns

Hello everybody,

is there a way to do this??

 

sss.png

 

in the source table columns are: pieni_export,cmp_export,gp_export,vid_export,pieni_import,cmp_import,gp_import,vid_import

 

i want to show them like the way above using matrix Smiley Sad 

1 ACCEPTED SOLUTION
v-haibl-msft
Microsoft
Microsoft

@Iheb_Ghali

 

We need to do some transforms to you source table in Query Editor firstly. Assuming we have a Table1 like below.

Create column above columns_1.jpg

 

  1. Select all columns in Table1 and click Unpivot Columns in Transform ribbon.
    Create column above columns_2.jpg
  2. Rename Attribute to SubType.
  3. Select SubType and click Split Column by Delimiter in Home ribbon.
    Create column above columns_3.jpg
  4. Rename SubType.1 to SubType, SubType.2 to Type.
    Create column above columns_4.jpg
  5. Right click Table1 in left Queries pane and select Duplicate, rename the duplicated table to Table2.
  6. Remove the Type column in Table2 and add another new custom column named Type with “TOTAL” string.
    Create column above columns_5.jpg
  7. Click Group By in the Home ribbon, sum the values group by Type and SubType.
    Create column above columns_6.jpg
  8. Select Table1 in left Queries pane and click Append Queries in Home ribbon. Select Table2 to append.
    Create column above columns_7.jpg
  9. Close & Apply Query Editor. Drag Type and SubType into Columns, Value into Values in Matrix.
    Create column above columns_8.jpg

I’ve also uploaded my PBIX file here for reference.

 

Best Regards,

Herbert

View solution in original post

4 REPLIES 4
v-haibl-msft
Microsoft
Microsoft

@Iheb_Ghali

 

We need to do some transforms to you source table in Query Editor firstly. Assuming we have a Table1 like below.

Create column above columns_1.jpg

 

  1. Select all columns in Table1 and click Unpivot Columns in Transform ribbon.
    Create column above columns_2.jpg
  2. Rename Attribute to SubType.
  3. Select SubType and click Split Column by Delimiter in Home ribbon.
    Create column above columns_3.jpg
  4. Rename SubType.1 to SubType, SubType.2 to Type.
    Create column above columns_4.jpg
  5. Right click Table1 in left Queries pane and select Duplicate, rename the duplicated table to Table2.
  6. Remove the Type column in Table2 and add another new custom column named Type with “TOTAL” string.
    Create column above columns_5.jpg
  7. Click Group By in the Home ribbon, sum the values group by Type and SubType.
    Create column above columns_6.jpg
  8. Select Table1 in left Queries pane and click Append Queries in Home ribbon. Select Table2 to append.
    Create column above columns_7.jpg
  9. Close & Apply Query Editor. Drag Type and SubType into Columns, Value into Values in Matrix.
    Create column above columns_8.jpg

I’ve also uploaded my PBIX file here for reference.

 

Best Regards,

Herbert

Thank you very much @v-haibl-msft !!!

 

You saved my life, its working like magic Smiley Happy

very Very nice solution

HeroPost
Frequent Visitor

Hi,

it can be done, but you may have to edit your source data, so the export, and import ar dimensions in one column and Pieni, CMP, GP and vid are in another column

then you can use the dimensions as columns in a matrix visual

 

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors