Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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:
region | unitID | rentalStatus | manager |
Chicago | 1 | Available | John |
Chicago | 2 | Rented | John |
Miami | 3 | Available | Sally |
Miami | 4 | Available | Sally |
Miami | 5 | Rented | Susan |
How would I achieve the following summary output in a single table?
Field | Dimension | Count |
region | Chicago | 2 |
region | Miami | 3 |
unitID | 1 | 1 |
unitID | 2 | 1 |
unitID | 3 | 1 |
unitID | 4 | 1 |
unitID | 5 | 1 |
rentalStatus | Available | 3 |
rentalStatus | Rented | 2 |
manager | John | 2 |
manager | Sally | 2 |
manager | Susan | 1 |
Solved! Go to Solution.
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.
Just a note.. This seems pretty odd, what is your use case? Maybe we can come up with a better solution for you.
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.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
98 | |
79 | |
74 | |
66 |
User | Count |
---|---|
136 | |
109 | |
104 | |
82 | |
73 |