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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Group wise Count measure

hi Experts,

i have data like below

Group nameDealer 
Group12100
Group19435
Group13254
Group12143
Group25443
Group24524
Group26455
Group37544
Group34325
Group34354
Group36543

 

now i have one slicer as a Dealer, whenever i selected value from dealer slicer i want to show entire dealer group count number.

 

EX: i selected 2100 dealer from slicer then measure should show 4 (because 2100 value we have in group1 so we need group1 Count)

 

thanks & regards

Don

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@Anonymous 

Try this.

Group Count = 
VAR _Group =
    SELECTEDVALUE ( 'Table'[Group name] )
RETURN
    CALCULATE (
        COUNTROWS ( 'Table' ),
        REMOVEFILTERS ( 'Table'[Dealer] ),
        'Table'[Group name] = _Group
    )

jdbuchanan71_0-1632850001721.png

 

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

If you want it to work when selecting multiple Dealers we can do it like this instead.

Group Count = 
VAR _Group =
    DISTINCT ( 'Table'[Group name] )
RETURN
    CALCULATE (
        COUNTROWS ( 'Table' ),
        REMOVEFILTERS ( 'Table'[Dealer] ),
        _Group
    )
jdbuchanan71
Super User
Super User

@Anonymous 

Try this.

Group Count = 
VAR _Group =
    SELECTEDVALUE ( 'Table'[Group name] )
RETURN
    CALCULATE (
        COUNTROWS ( 'Table' ),
        REMOVEFILTERS ( 'Table'[Dealer] ),
        'Table'[Group name] = _Group
    )

jdbuchanan71_0-1632850001721.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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