Forum Discussion
How do I count distinct values (words) across multiple columns.
Greetings,
I have columns with similar data (e.g. words), and I want to count the TOTAL number frequency of the words across all three columns. So if the world "airplane" occurs 5 times in column B, 6 times in column F, and 9 times in column G, I would get a Total count for the word "airplane" of: 20
Is there a formula I can use?
Thanks in advance!
If you don't have a list if the unique value you my create it as a calculated table
List =
DISTINCT (
SELECTCOLUMNS (
UNION (
ALLNOBLANKROW ( 'Table'[Column B] ),
ALLNOBLANKROW ( 'Table'[Column F] ),
ALLNOBLANKROW ( 'Table'[Column G] )
),
"Value", [Column B]
)
)make sure no relationships are created automatically.
then you an place List[Value] in a table or chart visual along with the following measureCount =
SUMX (
VALUES ( List[Value] ),
COUNTROWS (
FILTER (
'Table',
List[Value] IN { 'Table'[Column B], 'Table'[Column F], 'Table'[Column G] }
)
)
)
3 Replies
- tamerj1
Community Champion
If you don't have a list if the unique value you my create it as a calculated table
List =
DISTINCT (
SELECTCOLUMNS (
UNION (
ALLNOBLANKROW ( 'Table'[Column B] ),
ALLNOBLANKROW ( 'Table'[Column F] ),
ALLNOBLANKROW ( 'Table'[Column G] )
),
"Value", [Column B]
)
)make sure no relationships are created automatically.
then you an place List[Value] in a table or chart visual along with the following measureCount =
SUMX (
VALUES ( List[Value] ),
COUNTROWS (
FILTER (
'Table',
List[Value] IN { 'Table'[Column B], 'Table'[Column F], 'Table'[Column G] }
)
)
)