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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
StuartSmith
Power Participant
Power Participant

Grouping Similar Rows

Looking for ideas on how I could handle some data similar to the below...

 

Region Country City Building Headcount
EMEA UK London LON01 5
EMEA UK London LON02 0
EMEA UK London LON03 1
EMEA UK Manchester MAN01 4
EMEA Spain Madrid MAD01 2
EMEA Spain Madrid MAD02 0
EMEA Spain Barcalona BAR01 7

 

and looking to maybe create a new column that displays the "Cluster Headcount" for all rows where the "Building" has the same 1st 3 characters.

 

Region Country City Building Headcount Cluster Headcount
EMEA UK London LON01 5 6
EMEA UK London LON02 0 6
EMEA UK London LON03 1 6
EMEA UK Manchester MAN01 4 4
EMEA Spain Madrid MAD01 2 2
EMEA Spain Madrid MAD02 0 2
EMEA Spain Barcalona BAR01 7 7

 

and also a new table similar to...where it groups all the values of "Headcount" for each building with the same 1st 3 Cahracters.

 

Region Country City Building Cluster Headcount
EMEA UK London LON 6
EMEA UK Manchester MAN 4
EMEA Spain Madrid MAD 2
EMEA Spain Barcalona BAR 7

Thanks in Advance,

1 ACCEPTED SOLUTION
rsbin
Super User
Super User

@StuartSmith ,

Create 2 Calculated Columns:

BuildingAbbr = LEFT( [Building], 3 )

ClusterHeadcount = CALCULATE( SUM( [Headcount]),
                          ALLEXCEPT( Headcount, Headcount[BuildingAbbr] ))

Then create a Table Visual dragging in whatever fields you want to see.

rsbin_2-1698176947130.png

Trust this is what you are looking for.

Regards,

 

 

View solution in original post

1 REPLY 1
rsbin
Super User
Super User

@StuartSmith ,

Create 2 Calculated Columns:

BuildingAbbr = LEFT( [Building], 3 )

ClusterHeadcount = CALCULATE( SUM( [Headcount]),
                          ALLEXCEPT( Headcount, Headcount[BuildingAbbr] ))

Then create a Table Visual dragging in whatever fields you want to see.

rsbin_2-1698176947130.png

Trust this is what you are looking for.

Regards,

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.