cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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

Accepted Solutions
Highlighted

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

Try this.

 

View solution in original post

9 REPLIES 9
Highlighted
Frequent Visitor

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

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

Highlighted

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"))

Highlighted

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.

Highlighted

Yes. It's actually Failed then various resons

Highlighted

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

Highlighted

Would this be the correct complete syntax?

 

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

Highlighted

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

Try this.

 

View solution in original post

Highlighted

That did it thank you!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Community Conference

Microsoft Power Platform Communities

Check out the Winners!

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors