Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi All
Just looking for some direction 😊
I have a formula that is working fine.
COUNT_WCdr = CALCULATE(
COUNTROWS(GN_EMPLOYEE_DATA),
SEARCH("Watch Commander",GN_EMPLOYEE_DATA[JOB_TITLE],,0)
&& SEARCH("(OPS)",GN_EMPLOYEE_DATA[JOB_TYPE],,0)
)+0
As you can see it searches from 2 different columns and works fine.
So my question is why does the formula not work when add another search from one of the columns used as an OR
Example
COUNT_WCdr = CALCULATE(
COUNTROWS(GN_EMPLOYEE_DATA),
SEARCH("WCdr",GN_EMPLOYEE_DATA[JOB_TITLE],,0)
&& SEARCH("(OPS)",GN_EMPLOYEE_DATA[JOB_TYPE],,0)
|| SEARCH("Department",GN_EMPLOYEE_DATA[JOB_TYPE],,0) /*added parameter*/
)+0
Any help given is great and another learning step for me 😎
Gary
Hi @gazzo1967 ,
Please have a try.
Modify the formula.
COUNT_WCdr =
CALCULATE (
COUNTROWS ( GN_EMPLOYEE_DATA ),
(
SEARCH ( "Watch Commander", GN_EMPLOYEE_DATA[JOB_TITLE],, 0 )
&& SEARCH ( "(OPS)", GN_EMPLOYEE_DATA[JOB_TYPE],, 0 )
)
(|| SEARCH ( "Department", GN_EMPLOYEE_DATA[JOB_TYPE],, 0 )) + 0
)
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I also tried this
COUNT_WCdr = CALCULATE( COUNTROWS(GN_EMPLOYEE_DATA),
CONTAINS(GN_EMPLOYEE_DATA,
GN_EMPLOYEE_DATA[JOB_TITLE], "Watch Commander"),
OR( CONTAINS(GN_EMPLOYEE_DATA, GN_EMPLOYEE_DATA[JOB_TYPE], "(OPS)"), CONTAINS(GN_EMPLOYEE_DATA, GN_EMPLOYEE_DATA[JOB_TYPE], "Department") ) )
But i get a syntax of too many CONTAINS
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
70 | |
38 | |
27 | |
26 |
User | Count |
---|---|
97 | |
96 | |
59 | |
44 | |
40 |