Join 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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
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
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.