Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
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
| User | Count |
|---|---|
| 76 | |
| 36 | |
| 31 | |
| 29 | |
| 26 |