Forum Discussion
DAX function to count specific text values from a column
- 10 years ago
You need to write a formula like which will count all the rows containing "This Value"
CountValues = CALCULATE ( COUNTROWS ( TableName ); TableName[ColumnName] = " This Value " )
Hello Everyone,
I'm fairly new to DAX measures and i ran into a problem at work. So i have an employee data base table and i want to count total number of employees, all managers in each dept, all supervisors and instructors from a table.
To calculate all the employees i've used following epression and it worked.
Total no. of Employees : COUNTROWS([EmployeesDataBase])
But now i want to calculate total number of managers from (Table - EmployeeDataBase) Column(JobDescription). jobDesc isn't named consistently. They used "Manager 'Somedept'" and also "Mgr". So i wanted to count number of rows from "jobDesc" Column so in excel i could have used wild card " (COUNTIFS ( [jobdesc], {"*Manager*, "*mgr*"})
But Can't figure out how to use this formula in DAX Measure.
PLZ Help. I need this formula for my work Tmrw. Thanks in Advance.
Column = IF(SEARCH("Word",[ColumnName],1,0)>0,1,0)
I will return a 1 if the "Word" is found. Compair to Countif in Excel