Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
555 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Stop automatic grouping in Power BI Desktop |
---|
Read this blog to understand the risk of Power BI's automatic grouping of data, and to learn how to avoid getting caught out! |
For those new to aggregation in programmes other than Excel, it's worth noting what happens when using aggregates in visuals in Power BI. To demonstrate this, consider this table:
A simple table listing the number of products sold in each store.
Everything looks fine at first glance, although Arndale Centre looks a bit of an outlier. Maybe it is in London? Let's check the towns these centres belong to:
Uh oh! Turns out that there are several centres called Arndale Centre - Power BI has grouped the sales to centres of the same name.
You can see what's going on more clearly if you count how many times each Centre appears:
Each centre has its own row in the table, so we can check if the same name appears multiple times.
The easiest way to fix this problem is to use a unique identifier for each centre within the table visual to split up centres with the same name. We already have a unique column called CentreID:
Make sure to un-aggregate the column by choosing Don't Summarize, otherwise Power BI will try to SUM or COUNT it.
If you don't have a nice ready-made column to hand, not to fear. We can add one pretty easily in Query Editor. First click this button:
The Edit Queries button on the Home tab.
We could do a similar thing by using the RAND or RANDBETWEEN functions in a calculated column.
Select the table you want to add the new unique column to (for us it is the Centre table). Then choose Index Column from the Add Column tab:
It is never recommended to use From 0 unless you have a good reason to do so!
You can now use your new column to stop the aggregation of centres with the same name:
Remember to change the aggregation to Don't Summarize, or all your hard work will be for naught!
If you don't want to see the column simply drag the column width so small you can't see it, just like you would in Excel:
You will need to turn Word wrap off for both the Column headers and Values, or risk getting really long column headers!
Some other pages relevant to the above blog include:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.