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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jmiridium
Helper IV
Helper IV

CALCULATE and FILTER With Text

How do I add a column using CALCULATE and FILTER with text results? Urgent

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Failed = CALCULATE(
    COUNT(ComputerStatus[Acrobat]),
    LEFT(ComputerStatus[Acrobat], 6) = "FAILED")
)

Try this.

 

View solution in original post

9 REPLIES 9
rventura
Frequent Visitor

Completed = 
CALCULATE(
    COUNTROWS(incidents),
    FILTER(incidents, incidents[Ticket Status] = "Completed"),
    FILTER(incidents, incidents[Location] = locations[Location])
)

Too many arguments were passed to the COUNTROWS function. The maximum argument count for the function is 1.

OK I think I have somewhat of an idea how to get it going. How do I enter a wildcard on a text field?

 

Example:

 

Failed =
CALCULATE(
    COUNT(ComputerStatus[Acrobat]),
    FILTER(ComputerStatus, ComputerStatus[Acrobat] = "FAILED"))

Anonymous
Not applicable

Is failed always going to be the first 6 characters?  If so, use LEFT([YourField], 6) = "FAILED".  Failing that there is a function called FIND which returns true or false if it finds a subtext within a larger text.

 

For performance reasons, LEFT is going to be faster but if its not suitable FIND will work in a similar manner to the wildcarding you were hoping for.

Yes. It's actually Failed then various resons

Anonymous
Not applicable

Then i think LEFT([YourField], 6) = "FAILED" will work for you.

Would this be the correct complete syntax?

 

Failed =
CALCULATE(
    COUNT(ComputerStatus[Acrobat]),
    FILTER(ComputerStatus, ComputerStatus[Acrobat] = LEFT([YourField], 6) = "FAILED"))

Anonymous
Not applicable

Failed = CALCULATE(
    COUNT(ComputerStatus[Acrobat]),
    LEFT(ComputerStatus[Acrobat], 6) = "FAILED")
)

Try this.

 

That did it thank you!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.