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
DavePowerBI
Frequent Visitor

Distinct count measure Matrix visual filter issues

Hi,

I have the following two measure but the issue I have is when I go to the filter visual for any of these two measures I get the advanced filter option and when I apply the filter Is greater than 1 or any other scenario I get the below, I have tried to change the format of the data and measure but makes no difference.

Not sure if something needs to be added to the measure calculation inorder for the visual  filter to work

Appreciate any help that can be provided. 

 

# Count Users in ID = DISTINCTCOUNT('DataTable'[Name])

 


# Highlight Rule = IF( HASONEFILTER('DataTable'[ID]) && 'DataTable'[# Count Users in ID] > 1, 1, 0 )

 

 

image003 (3).png

1 ACCEPTED SOLUTION

Hi @DavePowerBI,

You can use the following measure formula on the visual level filter to filter records:

flag = 
VAR summary =
    SUMMARIZE (
        ALLSELECTED ( 'Table' ),
        [Country],
        [ID],
        "c_Name", DISTINCTCOUNT ( 'Table'[Name] )
    )
RETURN
    IF (COUNTROWS ( FILTER ( summary, [c_Name] > 1 && [ID] IN VALUES ( 'Table'[ID] ) ) ) > 0, 1, 0)

1.PNGRegards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

Hi @DavePowerBI,

Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

@v-shex-msft All,

 

As requested, please find the data below along with all the rows and columns for the matrix.  I need to be able to find out which IDs has >1 name under it and illustrate this including the Names and Countries.

 

I cannot filter by #Count Users in ID or #highlight Rule columns.

 

I have also tried to see if I was able to do a work around with a visual conditional background colour formatting on the #Count users in ID column which works (see screenshot) but the  visual filter does not allow me to filter by highlighted cell or number. Thank you for assistance.

 

Expected output or similar

 

image005.png

image006.png

image007 (1).png

image008 (1).png

image010.png

RAW DATA

Country

ID

Name

USA

121

Tony Smith

USA

121

Teri Harry

UK

212

Rob T

UK

212

Sam L

UK

212

Nick T

UK

214

Fred P

FRANCE

811

Tina B

FRANCE

812

Brad H

FRANCE

813

Lipi G

FRANCE

814

Honey G

FRANCE

815

Wes D

USA

122

Jame Spot

USA

123

Chris Martin

USA

124

Adam N

USA

125

Paul S

USA

126

Matt R

 

 

 

Hi @DavePowerBI,

You can use the following measure formula on the visual level filter to filter records:

flag = 
VAR summary =
    SUMMARIZE (
        ALLSELECTED ( 'Table' ),
        [Country],
        [ID],
        "c_Name", DISTINCTCOUNT ( 'Table'[Name] )
    )
RETURN
    IF (COUNTROWS ( FILTER ( summary, [c_Name] > 1 && [ID] IN VALUES ( 'Table'[ID] ) ) ) > 0, 1, 0)

1.PNGRegards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.