Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I'm working with a table that has the Name, ID and location of different entities that I need to consolidate. In many instances the entity is repeated multiple times based on different locations. Locations are scored, but there can be multiple locations for a single entity that have the same score. I would like to summarize this data based on the unique ID so each only appers one time, and in the instance where there are locations with different scores it uses the highest score, but if there are ties for the highest score then it doesn't matter which row it uses, but it does need to consolidate to a single row. I can't share the actual data, but I created a dummy version of the before and after that I'm looking for. This table is a sample of what the data looks like:
Name | ID | Street Address | City | Postal Code | State | Country | Score |
Acme | 1 | 1234 Anywhere | Denver | 80222 | CO | United States | 15 |
Acme | 1 | 456 Main | Parker | 80134 | CO | United States | 15 |
Sample | 12 | PO Box 1235 | Dallas | TX | United States | 14 | |
Sample | 12 | Los Angeles | United States | 12 | |||
Contoso | 5 | El Paso | TX | United States | 7 |
And below is what I'd like the final output to look like. For ACME I don't care if it selects the Parker or Denver row since the scores were the same, I just need to ensure it consolidates to a single row/entry. For Sample the PO Box row will be used because it was scored higher than the row with Los Angeles as the city, and Contoso has a single entry so that will remain as-is.
Name | ID | Street Address | City | Postal Code | State | Country | Score |
Acme | 1 | 456 Main | Parker | 80134 | CO | United States | 15 |
Sample | 12 | PO Box 1235 | Dallas | TX | United States | 14 | |
Contoso | 5 | El Paso | TX | United States | 7 |
Solved! Go to Solution.
@mterry , based on what I got. You can create a Rank (new function) or row number using the partition of name and order by unique rank. or add an index column in the power query and then use a visual level filter for rank =1
Power BI - New DAX Function: RANK - How It Differs from RANKX: https://youtu.be/TjGkF44VtDo
Power BI - New DAX Function: Rownumber- https://www.youtube.com/watch?v=yS9-IQjUDwg&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L&index=1
Power Query- Index Column: https://youtu.be/NS4esnCDqVw
@mterry , based on what I got. You can create a Rank (new function) or row number using the partition of name and order by unique rank. or add an index column in the power query and then use a visual level filter for rank =1
Power BI - New DAX Function: RANK - How It Differs from RANKX: https://youtu.be/TjGkF44VtDo
Power BI - New DAX Function: Rownumber- https://www.youtube.com/watch?v=yS9-IQjUDwg&list=PLPaNVDMhUXGYo50Ajmr4SgSV9HIQLxc8L&index=1
Power Query- Index Column: https://youtu.be/NS4esnCDqVw
Thanks!
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
55 | |
54 | |
54 | |
37 | |
29 |
User | Count |
---|---|
77 | |
62 | |
45 | |
40 | |
40 |