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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
empoweredbi
Regular Visitor

Counts for several fields in a single table

All of my variables are strings. I want to summarize/tally the number of times that every type of string occurs, for every column/field, for every row in my data set. 

 

Given this input data:

 

regionunitIDrentalStatusmanager
Chicago1AvailableJohn
Chicago2RentedJohn
Miami3AvailableSally
Miami4AvailableSally
Miami5RentedSusan

 

How would I achieve the following summary output in a single table? 

 

FieldDimensionCount
regionChicago2
regionMiami3
unitID11
unitID21
unitID31
unitID41
unitID51
rentalStatusAvailable3
rentalStatusRented2
managerJohn2
managerSally2
managerSusan1

 

1 ACCEPTED SOLUTION
Syk
Super User
Super User

You can select all your columns in Power Query editor and under the transform tab hit unpivot columns. This will give you the Attribute and Value columns you're looking for.

You can then create a merged column to get all of your combinations into one column and in Power BI desktop count your merged column.

Syk_0-1661279479465.png



Just a note.. This seems pretty odd, what is your use case? Maybe we can come up with a better solution for you.



View solution in original post

2 REPLIES 2
Syk
Super User
Super User

You can select all your columns in Power Query editor and under the transform tab hit unpivot columns. This will give you the Attribute and Value columns you're looking for.

You can then create a merged column to get all of your combinations into one column and in Power BI desktop count your merged column.

Syk_0-1661279479465.png



Just a note.. This seems pretty odd, what is your use case? Maybe we can come up with a better solution for you.



Thank you for the suggestion, Syk, I'll give it a try.

 

Our use case is the development of several dashboards that will help validate the integrity of data in multiple systems. We have many critical tables that are updated multiple times a year by dozens of employees and it's common for one or more employees to etiher fail to enter important data or to enter incorrect data. Therefore, one of the goals of our validation dashboards will be to pull in every important variable and compare the distribution of dimensions (e.g. how many rental units are in Chicago, how many rental units are available, etc.) to prior data snapshots, in order to get a sense of whether or not the data looks comparable to historical records or whether there are significant deviations. By simply showing the frequency/counts of each dimension in each field, we believe we can get a good sense of the integrity of the data. For instance, if we suddenly see that there are no records for Chicago - or perhaps that every single unit is marked as Available - we can try to track down where the data has gone missing/bad. 

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