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

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

Reply
plugwater
Frequent Visitor

Pivot data and column from another to create a new table

Hi,

 

I have a table A 

Column1Column2Column3Column4
1AARRTT
 BBRR 

 

This needs to be converted into a new table for Table B

 

ColumnNameCount
Column11
Column22
Column32
Column41

 

This is to plot a visual to see the columns with the most or least values.

 

Thanks.

2 ACCEPTED SOLUTIONS
audreygerred
Super User
Super User

Hello! In Power Query you can select all of your columns, go to the Transform tab in the ribbon, then select Unpivot Columns, then rmove blanks from Value. Once you have that done it should look like this:

audreygerred_1-1698820104292.png

Once back in Power BI, create the count measure:

Count = COUNTROWS('Table')
 
audreygerred_2-1698820174707.png

 

 





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

Proud to be a Super User!





View solution in original post

Ritaf1983
Super User
Super User

Hi @plugwater 
To get the option of analyzing columns as "values", you need to unpivot this table.
The steps on PQ :

1. As there is no category column, except these to unpivot, add the blank column.

Ritaf1983_0-1698820243868.png

2. select this column and "unpivot others"

Ritaf1983_1-1698820365581.png

3 . Filter out the blank rows from values

Ritaf1983_2-1698820454632.png

4. Remove unneeded column

Ritaf1983_3-1698820514471.png

5. Create simple countrows measure  with Dax (after close and apply):

count_rep = COUNTROWS('Table')
Ritaf1983_4-1698820707913.png

PBIX is attached you can download and follow my steps

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

2 REPLIES 2
Ritaf1983
Super User
Super User

Hi @plugwater 
To get the option of analyzing columns as "values", you need to unpivot this table.
The steps on PQ :

1. As there is no category column, except these to unpivot, add the blank column.

Ritaf1983_0-1698820243868.png

2. select this column and "unpivot others"

Ritaf1983_1-1698820365581.png

3 . Filter out the blank rows from values

Ritaf1983_2-1698820454632.png

4. Remove unneeded column

Ritaf1983_3-1698820514471.png

5. Create simple countrows measure  with Dax (after close and apply):

count_rep = COUNTROWS('Table')
Ritaf1983_4-1698820707913.png

PBIX is attached you can download and follow my steps

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
audreygerred
Super User
Super User

Hello! In Power Query you can select all of your columns, go to the Transform tab in the ribbon, then select Unpivot Columns, then rmove blanks from Value. Once you have that done it should look like this:

audreygerred_1-1698820104292.png

Once back in Power BI, create the count measure:

Count = COUNTROWS('Table')
 
audreygerred_2-1698820174707.png

 

 





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

Proud to be a Super User!





Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors