Forum Discussion
Help with distinct count in a new table
I need a distinct count of "Sandningsnr" per "Kst" and "Month" in a new table.
When I try to do it I can only count "Sandningsnr" per "Kst" or "Month", not both.
Any suggestions?
Hi,
as amitchandak says:
You can create a table like:CalculatedTable = Summarize( Table1, Table1[Sandningsnr], Table1[Kst], Table1[Month], ,"@Count" , countrows(Table1) )
Take care.
5 Replies
- amitchandak
Super User
Dhjlm , I do not see any month column.
You can have measure like
countrows(summarize(Table,[Sandningsnr],[per Kst]))
table like summarize(Table,[Sandningsnr],[per Kst])
- DhjlmFrequent Visitor
There is a month column in my table (not in picture).
Yes I can use summarize, but not on both "Kst" and "Month"
- amitchandak
Super User
Dhjlm ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
- ErikHamoen
Resolver I
Hi,
as amitchandak says:
You can create a table like:CalculatedTable = Summarize( Table1, Table1[Sandningsnr], Table1[Kst], Table1[Month], ,"@Count" , countrows(Table1) )
Take care. - AnonymousNot applicable
HI Dhjlm,
I think you can use summarize or group by functions to summary your table and use these categories that you want to as group fields, then you can add a custom expression field to count the values of the field based on the current group.
Regards,
Xiaoxin Sheng