Forum Discussion
PowerBI: Count values in a Matrix
- 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
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
mahoneypat
Thank you for your reply.
I am actually interested in the duplicates only. I would like to be able to identify those because they mean 2 failures have occurred.
If only one failure occures(does NOT have a duplicate), I would like to exclude that.
- mahoneypat5 years ago
Microsoft Employee
Just change the "No" part of the IF to BLANK(). Once you do that rows that do not have duplicates will automatically filtered out of the visual.
Regards,
Pat