Forum Discussion

eryan123's avatar
eryan123
Frequent Visitor
5 years ago
Solved

PowerBI: Count values in a Matrix

Hello All,    I am trying to figure out how to count the values inside a matrix in a measure.  My raw data looks like this. I have a large number of values and a large number of categories that ...
  • mahoneypat's avatar
    5 years ago

    Note your example data has spaces in it that result in no duplicates.  Once those are removed in query, this measure expression works in a table visual with the Value# column to get your desired result.

     

    Duplicates =
    VAR summary =
        SUMMARIZE (
            CatTypes,
            CatTypes[Category Type],
            "@count"COUNT ( CatTypes[Category Type] )
        )
    RETURN
        IF (
            COUNTROWS (
                FILTER (
                    summary,
                    [@count] > 1
                )
            ) > 0,
            "Yes",
            "No"
        )

     

    Regards,

    Pat