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
Macpanzer
New Member

Groups

Possibility of "search" and "alphabetic order" in Groups funtcions

Macpanzer_0-1761572493432.png

 

7 REPLIES 7
v-priyankata
Community Support
Community Support

Hi @Macpanzer 

Thank you for reaching out to the Microsoft Fabric Forum Community.

@Nasif_Azam @raisurrahman Thanks for the inputs.

I hope the information provided by users was helpful. If you still have questions, please don't hesitate to reach out to the community.

 

Hi @Macpanzer 

Hope everything’s going smoothly on your end. I wanted to check if the issue got sorted. if you have any other issues please reach community.

Macpanzer
New Member

Thank you!

Nasif_Azam
Super User
Super User

Hey  @Macpanzer ,

In Power BI, it is true that managing large datasets with a list of municipalities can be cumbersome without a proper search or alphabetic ordering function in the grouping options. Here are a few approaches to improve your workflow, along with the steps to implement each solution:

 

1) Preprocessing in Power Query with Sorting & Grouping: To organize your municipalities alphabetically before grouping, use Power Query to preprocess your data. Steps:

  • Open Power BI Desktop.

  • Click on Transform Data to open Power Query Editor.

  • Select the column with the municipalities (e.g., Municipality Name).

  • To sort the municipalities alphabetically: Right-click the column header and choose Sort Ascending.

  • To group municipalities into countries (if they are not already):

    • Select the Municipality Name column and go to the Transform tab.

    • Choose Group By.

    • In the dialog box, select Advanced and choose to group by Country or any relevant field.

 

2) Using DAX for Custom Grouping:

If you prefer to manage your groups using DAX, you can create a calculated column to assign each municipality to its respective country. Steps:

  • In Power BI Desktop, go to Modeling and select New Column.

  • Use a DAX formula like the following to create the groups:
CountryGroup = SWITCH(TRUE(),
  'Municipality'[Name] = "BERGAMO", "Italy",
  'Municipality'[Name] = "FERRARA", "Italy",
  'Municipality'[Name] = "LONDON", "UK",
  'Municipality'[Name] = "PARIS", "France",
  // Add more mappings here
  "Other"  // Default case
)

 

3) Creating a Lookup Table for Municipalities and Countries: If the data is large and involves many countries, you can create a lookup table that maps municipalities to countries. This can be done manually in Excel or another data source and then imported into Power BI. Steps:

  • Create a table in Excel with two columns: Municipality Name and Country.

  • In Power BI, go to Home > Get Data and select Excel.

  • Import the municipality-country mapping table.

  • Once imported, create a relationship between the municipality column in your main dataset and the Municipality Name column in the lookup table.

 

4) Using Excel for Additional Sorting and Grouping: If you need more advanced sorting and grouping tools:

  • Open the dataset in Excel.

  • Use the Sort function (Data > Sort) to arrange your municipalities alphabetically.

  • Apply filters or use Excel’s Find & Replace to correct groupings quickly.

  • Import the corrected dataset into Power BI by clicking Home > Get Data > Excel.

 

Best Regards,
Nasif Azam



Did I answer your question?
If so, mark my post as a solution!
Also consider helping someone else in the forums!

Proud to be a Super User!


LinkedIn
raisurrahman
Advocate I
Advocate I

@Macpanzer  I’d appreciate it if you could describe the problem in detail. Is it in Power Query or Power BI?

Sorry, Powerby. For various reasons and database limitations, I need to group approximately 20,000 different municipality names into their respective countries. During my check, however, I realized that several were grouped in the wrong group, but it's impossible to quickly search for the municipality to correct, as there is no tool available.

It’s better to address this through data modeling. You can create a Country dimension along with City and Municipality. 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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.