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
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
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.