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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Combining multiple columns for Table plot

Hi,

 

I have an excel sheet that looks something like this:

 

MerchantIDSales_JanRating_JanSales_FebRating_Feb
13004.54004.7
24444.74504.8

 

 

I want to create Table plots for each MerchantID.

On selecting a merchant ID "1" from filters, the table should look something like this:

 

MonthSalesRating
Jan3004.5
Feb4004.7

 

I am unable to figure out how to achieve the same. Someone, please help me out.

Thanks

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @Anonymous ,

 

the easiest is, if you unpivot the columns and then split the rating and sales. Try the following Power Query as an example how to do that:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTI2MACSJnqmIBLKNleK1YlWMgKxTUygIkDSFCJroRQbCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [MerchantID = _t, Sales_Jan = _t, Rating_Jan = _t, Sales_Feb = _t, Rating_Feb = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"MerchantID", Int64.Type}, {"Sales_Jan", Int64.Type}, {"Rating_Jan", type number}, {"Sales_Feb", Int64.Type}, {"Rating_Feb", type number}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"MerchantID"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Other Columns",{{"Attribute", "Type"}}),
    #"Inserted Text After Delimiter" = Table.AddColumn(#"Renamed Columns", "Month", each Text.AfterDelimiter([Type], "_"), type text),
    #"Extracted Text Before Delimiter" = Table.TransformColumns(#"Inserted Text After Delimiter", {{"Type", each Text.BeforeDelimiter(_, "_"), type text}}),
    #"Reordered Columns" = Table.ReorderColumns(#"Extracted Text Before Delimiter",{"MerchantID", "Type", "Month", "Value"})
in
    #"Reordered Columns"

 

 

Afterwards you can just add a slicer and a matrix:

selimovd_0-1651484551331.png

 

I attached my demo file.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @selimovd,

Thank you so much for the quick response. The power query worked perfectly for my use case. Marking your response as the solution. 🙂

selimovd
Super User
Super User

Hey @Anonymous ,

 

the easiest is, if you unpivot the columns and then split the rating and sales. Try the following Power Query as an example how to do that:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTI2MACSJnqmIBLKNleK1YlWMgKxTUygIkDSFCJroRQbCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [MerchantID = _t, Sales_Jan = _t, Rating_Jan = _t, Sales_Feb = _t, Rating_Feb = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"MerchantID", Int64.Type}, {"Sales_Jan", Int64.Type}, {"Rating_Jan", type number}, {"Sales_Feb", Int64.Type}, {"Rating_Feb", type number}}),
    #"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"MerchantID"}, "Attribute", "Value"),
    #"Renamed Columns" = Table.RenameColumns(#"Unpivoted Other Columns",{{"Attribute", "Type"}}),
    #"Inserted Text After Delimiter" = Table.AddColumn(#"Renamed Columns", "Month", each Text.AfterDelimiter([Type], "_"), type text),
    #"Extracted Text Before Delimiter" = Table.TransformColumns(#"Inserted Text After Delimiter", {{"Type", each Text.BeforeDelimiter(_, "_"), type text}}),
    #"Reordered Columns" = Table.ReorderColumns(#"Extracted Text Before Delimiter",{"MerchantID", "Type", "Month", "Value"})
in
    #"Reordered Columns"

 

 

Afterwards you can just add a slicer and a matrix:

selimovd_0-1651484551331.png

 

I attached my demo file.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.