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
kattlees
Post Patron
Post Patron

Count values from multiple columns into one.

I am trying to get a headcount of employees in a matrix. Each employee is assigned a "class" based on full time hourly, full time salary, PRN, or how part time.  How do I get the columns to show the count of a combination of classes so all full time are counted together and all prn and all part time? See below - the big one is what I am pulling (by class) and the small inset one is what I am trying to accomplish.

Matrix-Sample.jpg

1 ACCEPTED SOLUTION

I created a new column and grouped the classes by using =LEFT(Fieldname, # of characters) and it worked.

View solution in original post

4 REPLIES 4
haozhong
Resolver I
Resolver I

To make things easier, if you are pulling data, pull them in a flat table in excel then add additional column to group them class 1, class 2 etc in excel using a separate lookup table.

 

Then use power BI to read it

 

 

 

 

Not following the pulling them into a flat table in excel?   We pull directly from an sql database. I have added new columns to combine first and last name, etc. Just can't figure out the counts.

Flat table as in

 

RN | Class 1A 8833 | Class 1 | 2 |

RN | Class 3 8833 | Class 3 | 1 |

 

Easier to count that way in power BI or pivot tables in excel

 

just my opinion

 

 

I created a new column and grouped the classes by using =LEFT(Fieldname, # of characters) and it worked.

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.