Forum Discussion
Contains vs Equals
Hello brockry1
You can use the following DAX formula instead if you want to determine whether the
Subjectcolumn contains the "Training" string or not:# of completed events_Trainings = CALCULATE ( DISTINCTCOUNT ( 'Event & Task'[ID] ), 'Event & Task'[Status (Consolidated)] = "Completed", CONTAINSSTRING ( 'Event & Task'[Subject], "Training" ) = TRUE )The
CONTAINSSTRING()function is case-insensitive. However, if you require a strictly case-sensitive check, useCONTAINSSTRINGEXACT()instead.You can learn more about these functions here:
I have created small dataset of only 10 rows verify the, and here is the screenshot of it
I am also attaching the sample Power BI file for your reference.
Best Regards,
Udit
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo π
π Let's Connect: LinkedIn || YouTube || Medium || GitHub
β¨ Visit My Linktree: LinkTree
Proud to be a Super User
1 Reply
- quantumuditSuper User
Hello brockry1
You can use the following DAX formula instead if you want to determine whether the
Subjectcolumn contains the "Training" string or not:# of completed events_Trainings = CALCULATE ( DISTINCTCOUNT ( 'Event & Task'[ID] ), 'Event & Task'[Status (Consolidated)] = "Completed", CONTAINSSTRING ( 'Event & Task'[Subject], "Training" ) = TRUE )The
CONTAINSSTRING()function is case-insensitive. However, if you require a strictly case-sensitive check, useCONTAINSSTRINGEXACT()instead.You can learn more about these functions here:
I have created small dataset of only 10 rows verify the, and here is the screenshot of it
I am also attaching the sample Power BI file for your reference.
Best Regards,
Udit
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo π
π Let's Connect: LinkedIn || YouTube || Medium || GitHub
β¨ Visit My Linktree: LinkTree
Proud to be a Super User