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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
harshadrokade
Post Partisan
Post Partisan

How to create a common identifier between multiple columns

Hi All,

 

Pls help me with below query.

 

I have below table which I have uploaded on Power bi.

CategoryJAN 2023 Parameter1JAN 2023 Parameter2JAN 2023 Parameter3FEB 2023 Parameter1FEB 2023 Parameter2FEB 2023 Parameter3MAR 2023 Parameter1MAR 2023 Parameter2MAR 2023 Parameter3APR 2023 Parameter1APR 2023 Parameter2APR 2023 Parameter3
Category13248617710065476188813533
Category2714921357556882432472045
Category3286754639952232888925643
Category41009850975577454579525168
Category5654146318132907541672970
Category6513098675655966896588879

 

As I want all Months to be in month column so that I can create trend charts, I unpivot respective parameter columns for every month column & after that the data looks as below-

 

You can see the Month row for every paramter & not alligned. How can I bring same month/year for every parameter in same row so that I can have only 1 month/year column & I can generate some combo charts with multiple parameters combinaton?

 

harshadrokade_0-1685959866964.png

 

 

 

 

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

Hi @harshadrokade ,

You can use the "Unpivot Columns" feature in Power BI to bring all the months into a single column. After that, you can use the "Group By" feature to group the data by the month column and the parameter column. This will give you a single row for each month and parameter combination. You can then use this data to create combo charts with multiple parameter combinations.

Here are the steps to unpivot columns:

  1. Select the columns you want to unpivot.
  2. Right-click on the selected columns and select "Unpivot Columns".
  3. This will create a new column called "Attribute" and a new column called "Value". The "Attribute" column will contain the original column names, and the "Value" column will contain the values from those columns.
  4. Rename the "Attribute" column to "Month" or "Parameter" as appropriate.

Here are the steps to group by:

  1. Select the "Month" and "Parameter" columns.
  2. Go to the "Transform" tab and select "Group By".
  3. In the "New column name" field, enter a name for the new column that will contain the grouped values.
  4. In the "Operation" field, select the operation you want to perform on the grouped values (e.g. Sum, Average, Count).
  5. Click "OK" to create the new column.

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

2 REPLIES 2
v-rongtiep-msft
Community Support
Community Support

Hi @harshadrokade ,

You can use the "Unpivot Columns" feature in Power BI to bring all the months into a single column. After that, you can use the "Group By" feature to group the data by the month column and the parameter column. This will give you a single row for each month and parameter combination. You can then use this data to create combo charts with multiple parameter combinations.

Here are the steps to unpivot columns:

  1. Select the columns you want to unpivot.
  2. Right-click on the selected columns and select "Unpivot Columns".
  3. This will create a new column called "Attribute" and a new column called "Value". The "Attribute" column will contain the original column names, and the "Value" column will contain the values from those columns.
  4. Rename the "Attribute" column to "Month" or "Parameter" as appropriate.

Here are the steps to group by:

  1. Select the "Month" and "Parameter" columns.
  2. Go to the "Transform" tab and select "Group By".
  3. In the "New column name" field, enter a name for the new column that will contain the grouped values.
  4. In the "Operation" field, select the operation you want to perform on the grouped values (e.g. Sum, Average, Count).
  5. Click "OK" to create the new column.

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

thanks

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.