Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
I have a table with 3 columns like this:
Table1
In PowerBI I would like to count the frequency of each unique value/string and get it in a seperate table like this:
Table2
I'm finding all different ways of getting a list of the unique values like this:
Table2 =
DISTINCT(
UNION(
DISTINCT('Table1'[Column1]),
DISTINCT('Table1'[Column2]),
DISTINCT('Table1'[Column3])
)
)
Which now only gives me a list of distinct values/strings, but not with the count:
And I don't know how to get the count column with it.
Could someone help me to get the counts with it as well?
Solved! Go to Solution.
Try
Combined table =
VAR Col1 =
ADDCOLUMNS (
DISTINCT ( 'Table'[Column1] ),
"@count", CALCULATE ( COUNTROWS ( 'Table' ) )
)
VAR Col2 =
ADDCOLUMNS (
DISTINCT ( 'Table'[Column2] ),
"@count", CALCULATE ( COUNTROWS ( 'Table' ) )
)
VAR Col3 =
ADDCOLUMNS (
DISTINCT ( 'Table'[Column3] ),
"@count", CALCULATE ( COUNTROWS ( 'Table' ) )
)
VAR Result =
GROUPBY (
UNION ( Col1, Col2, Col3 ),
[Column1],
"Total count", SUMX ( CURRENTGROUP (), [@count] )
)
RETURN
Result
Try
Combined table =
VAR Col1 =
ADDCOLUMNS (
DISTINCT ( 'Table'[Column1] ),
"@count", CALCULATE ( COUNTROWS ( 'Table' ) )
)
VAR Col2 =
ADDCOLUMNS (
DISTINCT ( 'Table'[Column2] ),
"@count", CALCULATE ( COUNTROWS ( 'Table' ) )
)
VAR Col3 =
ADDCOLUMNS (
DISTINCT ( 'Table'[Column3] ),
"@count", CALCULATE ( COUNTROWS ( 'Table' ) )
)
VAR Result =
GROUPBY (
UNION ( Col1, Col2, Col3 ),
[Column1],
"Total count", SUMX ( CURRENTGROUP (), [@count] )
)
RETURN
Result
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.