Forum Discussion
count rows with same value in the one column
I have a column Department, that contains all the organisation departments eg
Deparment
Finance
Adminstration
Client Services
HR
Board
HR
HR
Finance
Finance
Finance
Technology
how can I count the total of each department in the 1 column
TIA
Hi,
In Power Query, create another tables with the unique departments. Create a relationship (Many to One and Single) from your Fact tables to the new tables. To a Table visual, drag Department from the new table. Write this measure
Count = countrows(Data)
Hope this helps.
Hy dd88
You can get your desired output by this simple measure.Best Regards,
Muhammad YousafIf this post helps, then please consider "Accept it as the solution" to help the other members find it more quickly.
5 Replies
- bhanu_gautam
Super User
dd88 , You can create a measure using below
DepartmentCount = COUNTROWS(VALUES(DepartmentsTable[Department]))- dd88
Post Patron
thank you bhanu_gautam
The result is a total departments ie 9
I would like to count the total of each department in the 1 column eg using the above data
Department column
Adminstration = 1
Board = 1
Client Services = 1Finance = 4
HR = 2
Technology = 1
TIA
- Ashish_Mathur
Super User
Hi,
In Power Query, create another tables with the unique departments. Create a relationship (Many to One and Single) from your Fact tables to the new tables. To a Table visual, drag Department from the new table. Write this measure
Count = countrows(Data)
Hope this helps.
- AnonymousNot applicable
Hi dd88
Have you solved your problem? If so, could you please mark the helpful replies as Answered to close this topic and that can help other members find it faster?
If not, could you please share your data(exclude sensitive data), or create some sample data, and your target outcome, so that we can help you better.
Thank you very much for your kind cooperation.
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.