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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Hugo_Wass
Regular Visitor

ContainsString with OR function

Hi there - PowerBi newbie here:

Could anybody highlight the error in my DAX expression below:

No of people with retakes = CALCULATE(DISTINCTCOUNT('people (2)'[Person ID]), FILTER('auditlogs all',CONTAINSSTRING('auditlogs all'[Description], OR("Sent Retake", "Sent Redo"))
))


I am trying to count the number of people in 'people' with auditlogs all'[Description] containing either "Sent Retake" or "Sent Redo"

I get no immediate error in the dax formula bar but when i try to add the measure to a visual i get the following error:

Hugo_Wass_0-1647263194395.png


Any help would be appreciated.



 

1 ACCEPTED SOLUTION
Adescrit
Impactful Individual
Impactful Individual

Could you try: 

 

No of people with retakes = CALCULATE(DISTINCTCOUNT('people (2)'[Person ID]), FILTER('auditlogs all',CONTAINSSTRING('auditlogs all'[Description], "Sent Retake") || CONTAINSSTRING('auditlogs all'[Description], "Sent Redo")))

 

The "||" operator represents OR in DAX. "&&" can be used for AND

 


Did I answer your question? Mark my post as a solution!
My LinkedIn

View solution in original post

2 REPLIES 2
Hugo_Wass
Regular Visitor

This worked - thank you!

Adescrit
Impactful Individual
Impactful Individual

Could you try: 

 

No of people with retakes = CALCULATE(DISTINCTCOUNT('people (2)'[Person ID]), FILTER('auditlogs all',CONTAINSSTRING('auditlogs all'[Description], "Sent Retake") || CONTAINSSTRING('auditlogs all'[Description], "Sent Redo")))

 

The "||" operator represents OR in DAX. "&&" can be used for AND

 


Did I answer your question? Mark my post as a solution!
My LinkedIn

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.