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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
AaronGlenn10
Helper III
Helper III

Creating Regions from a Group of Cities

I'm trying to create regions from a group of cities - for example, the Dallas-Fort Worth region is comprised of ~200 cities.  What is the best approach to accomplish?

 

Thank you so much!

 

~AGS

2 ACCEPTED SOLUTIONS
mahoneypat
Employee
Employee

You could bring in a table with city and state columns and merge that into your data.  Or you could make a Groups column yourself.

Use grouping and binning in Power BI Desktop - Power BI | Microsoft Docs

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

v-jayw-msft
Community Support
Community Support

Hi @AaronGlenn10 ,

 

If you already have a group column, you could use ALLEXCEPT() function to get the average for each group.

https://docs.microsoft.com/en-us/dax/allexcept-function-dax 

For example:

average = calculate(average('table'[value]),allexcept('table'[group]))

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

7 REPLIES 7
v-jayw-msft
Community Support
Community Support

Hi @AaronGlenn10 ,

 

If you already have a group column, you could use ALLEXCEPT() function to get the average for each group.

https://docs.microsoft.com/en-us/dax/allexcept-function-dax 

For example:

average = calculate(average('table'[value]),allexcept('table'[group]))

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
mahoneypat
Employee
Employee

You could bring in a table with city and state columns and merge that into your data.  Or you could make a Groups column yourself.

Use grouping and binning in Power BI Desktop - Power BI | Microsoft Docs

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


I've created a group but it doesn't work when I try to use as a visualization filter.

vanessafvg
Super User
Super User

what will your group be based on?   State?  county?  





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




I'm only focused on one state - Texas.  The regions [groups] will be based on cities.  Need to create four regions - DFW, Austin, San Antonio, and Houston.  The DFW region [group], for example, will have 200 cities.

 

Does that help?

as per @mahoneypat  I would go with the grouing option.





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




How would I calculate an average across this group:

 

Same Store TTM Delta % for ABILENE & ACTON & ADKINS & ALAMO & ALAMO HEIGHTS & ALBA =

CALCULATE(

    [Same Store TTM Delta %],

    'TABC'[location_city (groups) 2]

        IN { "ABILENE & ACTON & ADKINS & ALAMO & ALAMO HEIGHTS & ALBA" }

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.