Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
neil37
Advocate I
Advocate I

Summary Table with Simple Distinct Count

Hello, 

 

My request is rather simple. 

 

My data is simply set up like below:

CasenumDateType
12301/01/2022Vest
12301/01/2022Shoes
12401/03/2022Hat
12501/08/2022Shirt
12601/08/2022Pants

 

I just want to create a new table  to summarize the number of casenum's distinct count of the table above that is able to be filtered by other columns like Type or Date. 

 

DistinctCOuntColumn
5

 

Thank you for your assistance. 

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

I think there's 3 options that might work for you:

  1. If you just need a distinct count, you could always create a measure with DISTINCTCOUNT(Casenum).
  2. But if you need a new table, you can go back into PowerQuery then duplicate the table, go to Transform tab > Count Rows > To Table and load that into your data model
  3. Click on Table Tools > New Table and use something like Table = SUMMARIZE('Table', "DistinctCountColumn", DISTINCTCOUNT('Table'[Column1])) to create your summary table.

View solution in original post

5 REPLIES 5
vicky_
Super User
Super User

I think there's 3 options that might work for you:

  1. If you just need a distinct count, you could always create a measure with DISTINCTCOUNT(Casenum).
  2. But if you need a new table, you can go back into PowerQuery then duplicate the table, go to Transform tab > Count Rows > To Table and load that into your data model
  3. Click on Table Tools > New Table and use something like Table = SUMMARIZE('Table', "DistinctCountColumn", DISTINCTCOUNT('Table'[Column1])) to create your summary table.

Hi @vicky_ , 

 

Thank you for this solution - if I wanted to add a few columns from the original table as well in order to add relationships in the model and filter - what would have to add to that new table code? Thank you!

You can add the column name(s) between the 'Table' and "DistinctCountColumn".
e.g. if you wanted to add the Date, then it would be SUMMARIZE('Table', "Date", "DistinctCountColumn"DISTINCTCOUNT('Table'[Column1])) 

which would return the number of distinct Casenums per date.

Thank you @vicky_  what expression would be used after I name the second column if I just wanted it to list the Type of clothes (from the example)?

SummaryTable = SUMMARIZE('Table', "column name", ???? ('table'[column1]),"DistinctCountColumn",DISTINCTCOUNT('table'[column2]))

 

You may have already figured this out, but you will only need to provide a name for the new column if it's an aggregate column (e.g. COUNT, SUM, AVG... etc.). 
EDIT: I forgot to answer the question. Basically, you don't need an extra expression

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.