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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jagostinhoCT
Post Partisan
Post Partisan

COUNTROWS with multiple FILTER(FIND) criteria

Found this post on how to use multiple criteria but am not being able to make it to work when using the FILTER together with the FIND function.

 

What am I doing wrong?

I want to be able to count the number of rows that match BOTH criteria, i.e., cell contains "Family Category and Parameters" AND ends with ".rvt"

 

CAD Family Category and Parameters (RVT) Count = CALCULATE(
COUNTROWS('KBT Logs - Logs')
//Filtering all ".rvt"
FILTER('KBT Logs - Logs',FIND(".rvt",'KBT Logs - Logs'[LogInfo],,0)),
//Filtering all "Family Cat Param"
FILTER('KBT Logs - Logs',FIND("Family Category and Parameters",'KBT Logs - Logs'[LogInfo],,0)))

 

Thank you in advance.

J

1 ACCEPTED SOLUTION
v-jiascu-msft
Employee
Employee

Hi @jagostinhoCT,

 

It should work. Can you share a dummy sample of your data? 

Did you get any error messages? Or Just you got a wrong result?

BTW, you can put two conditions in one place like below.

CAD Family Category and Parameters (RVT) Count =
CALCULATE (
    COUNTROWS ( 'KBT Logs - Logs' ),
    FILTER (
        'KBT Logs - Logs',
        FIND ( ".rvt", 'KBT Logs - Logs'[LogInfo],, 0 )
            && FIND ( "Family Category and Parameters", 'KBT Logs - Logs'[LogInfo],, 0 )
    )
)

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-jiascu-msft
Employee
Employee

Hi @jagostinhoCT,

 

It should work. Can you share a dummy sample of your data? 

Did you get any error messages? Or Just you got a wrong result?

BTW, you can put two conditions in one place like below.

CAD Family Category and Parameters (RVT) Count =
CALCULATE (
    COUNTROWS ( 'KBT Logs - Logs' ),
    FILTER (
        'KBT Logs - Logs',
        FIND ( ".rvt", 'KBT Logs - Logs'[LogInfo],, 0 )
            && FIND ( "Family Category and Parameters", 'KBT Logs - Logs'[LogInfo],, 0 )
    )
)

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you @v-jiascu-msft.

 

Here is my final formula for the new added column. BTW, I have added the column outside of the query. Not sure if this is best practice or not but I found it easier to do it this way.

 

ActionGroup = IF(
//Criteria set for CAD Processes
'KBT Logs - Logs'[WindowName]="Import CAD Formats" ||
'KBT Logs - Logs'[WindowName]="Name" ||
('KBT Logs - Logs'[WindowName]="Family Category and Parameters" && 'KBT Logs - Logs'[File type]="rvt") ||
'KBT Logs - Logs'[WindowName]="Create Detail Group" ||
'KBT Logs - Logs'[WindowName]="New Drafting View",
"CAD Processes",

//Criteria for Families
IF(
'KBT Logs - Logs'[WindowName]="New Family - Select Template File" ||
('KBT Logs - Logs'[WindowName]="Family Category and Parameters" && 'KBT Logs - Logs'[File type]="rfa") ||
('KBT Logs - Logs'[WindowName]="Parameter Properties" && 'KBT Logs - Logs'[File type]="rfa"),
"Families",

//Criteria for Project Setup
IF(
'KBT Logs - Logs'[WindowName]="Create Model Group" ||
'KBT Logs - Logs'[WindowName]="Design Options" ||
'KBT Logs - Logs'[WindowName]="Import/Link RVT" ||
'KBT Logs - Logs'[WindowName]="Link CAD Format" ||
'KBT Logs - Logs'[WindowName]="Load Family" ||
('KBT Logs - Logs'[WindowName]="Parameter Properties" && 'KBT Logs - Logs'[File type]="rvt") ||
'KBT Logs - Logs'[WindowName]="Phasing" ||
'KBT Logs - Logs'[WindowName]="Select Items To Copy",
"Project Setup",
BLANK())))

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.