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

Count the Duplicate Value in Power BI ?

BI.PNG

How to count no. of Duplcaite values ?

For Example: 11214, 11409,11990 ID has 2 values each
So how can I get Total no. of Customer with 2 different value using Dax
--> In this case there are 3

1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @Anonymous

 

You can place a measure like this on a Card visual:

 

Customers with N Values =
VAR _N = 2 //Change this to set the number of values you are interested in 
RETURN
    COUNTROWS (
        FILTER (
            SUMMARIZECOLUMNS (
                Table1[Customer],
                "CountValues", DISTINCTCOUNT ( Table1[Value] )
            ),
            [CountValues] = _N
        )
    )

Instead of having _N hard-coded, you could use a slicer to set the value in a more dynamic fashion.

View solution in original post

1 REPLY 1
AlB
Super User
Super User

Hi @Anonymous

 

You can place a measure like this on a Card visual:

 

Customers with N Values =
VAR _N = 2 //Change this to set the number of values you are interested in 
RETURN
    COUNTROWS (
        FILTER (
            SUMMARIZECOLUMNS (
                Table1[Customer],
                "CountValues", DISTINCTCOUNT ( Table1[Value] )
            ),
            [CountValues] = _N
        )
    )

Instead of having _N hard-coded, you could use a slicer to set the value in a more dynamic fashion.

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.