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
sbgsmith
Regular Visitor

Group Rows in a Table based on count

I have a visual showing counts of individuals by County. The data source has multiple rows for each individual and county so it is aggregated using Count Distinct on the County field.

 

The visual currently looks like this.

 

COUNTY            Individuals

KINGS2000
BRONX1500
NEW YORK1250
QUEENS1000
RICHMOND300
HUDSON1
ESSEX1
HENRICO1

 

I am looking to group all counties where the value is 1 together and call it "OTHER". I am looking for it to look like this, where Hudson, Essex and Henrico are relabled as "OTHER" and their combined count is shown.

COUNTY            Individuals

KINGS2000
BRONX1500
NEW YORK1250
QUEENS1000
RICHMOND300
OTHER3

 

The values can change, so I need this to be calculated not just selecting the 3 counties in a group.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @sbgsmith ,

Here are the steps you can follow:

1. Create calculated Table:.

Table 2 =
var _table1=
SUMMARIZE(
    'Table',
    "COUNTY","Other",
    "Individuals",
    SUM('Table'[Individuals]))
    return
    UNION('Table',_table1)

2. Create calculated column in Table2.

Individuals_Column =
IF(
    'Table 2'[COUNTY]="Other",
    CALCULATE(COUNTROWS('Table 2'),FILTER(ALL('Table 2'),'Table 2'[Individuals]=1))
    ,
    [Individuals])

vyangliumsft_0-1657503783136.png

3. Create calculated Table

Table 3 =
var _table1=
FILTER(
    'Table 2',
    'Table 2'[Individuals_Column]<>1)
return
SUMMARIZE(
    _table1,
    [COUNTY],[Individuals_Column])

4. Result:

vyangliumsft_1-1657503783137.png

If you need pbix, please click here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi  @sbgsmith ,

Here are the steps you can follow:

1. Create calculated Table:.

Table 2 =
var _table1=
SUMMARIZE(
    'Table',
    "COUNTY","Other",
    "Individuals",
    SUM('Table'[Individuals]))
    return
    UNION('Table',_table1)

2. Create calculated column in Table2.

Individuals_Column =
IF(
    'Table 2'[COUNTY]="Other",
    CALCULATE(COUNTROWS('Table 2'),FILTER(ALL('Table 2'),'Table 2'[Individuals]=1))
    ,
    [Individuals])

vyangliumsft_0-1657503783136.png

3. Create calculated Table

Table 3 =
var _table1=
FILTER(
    'Table 2',
    'Table 2'[Individuals_Column]<>1)
return
SUMMARIZE(
    _table1,
    [COUNTY],[Individuals_Column])

4. Result:

vyangliumsft_1-1657503783137.png

If you need pbix, please click here.

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

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.

Top Solution Authors
Top Kudoed Authors