Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Count the Duplicate Value in Power BI ?



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

  • 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.

1 Reply

  • AlB's avatar
    AlB
    Icon for Community Champion rankCommunity Champion

    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.