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
Hi eryan123
Measures only return scalars, not tables. You can create a calculated table:
NewTable =
ADDCOLUMNS (
DISTINCT ( Table1[Value] ),
"IsThereDuplicate",
VAR dupsFound_ =
CALCULATE ( DISTINCTCOUNT ( Table1[Value] ) )
> CALCULATE ( DISTINCTCOUNT ( Table1[Value] ) )
RETURN
IF ( dupsFound__, "Yes", "No" )
)
I would recommend a visual with a measure though
Please mark the question solved when done and consider giving a thumbs up if posts are helpful.
Contact me privately for support with any larger-scale BI needs, tutoring, etc.
Cheers