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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

ContainsString Stopped Working as it did last week

Hi There, I'm trying to count projects with multiple columns each containing specific words.  I've been using Containsstring in a filter in calculate funtion but over the weekend, this stopped working.  What can I do to fix this.

Sample Data:

Project Number          Brand                                   Location

1                                  A, B, C                                  USA, MEX

2                                  A                                           MEX

3                                  B, C                                      USA

 

I had a Brand slicer with A, B, and C and a Location slicer with USA and MEX available.  My project count was

= CALCULATE( DistinctCount( Projects[Project Number] ),
        FILTER( Projects, CONTAINSSTRING( Projects[Brand], [Select Brand]),

        FILTER( Projects, CONTAINSSTRING( Projects[Location], [Select Location]) )

 

Please help & thanks in advance!

Status: Accepted
Comments
Anonymous
Not applicable

Hi @PowerBiIsFun ,

 

I did a test based on the sample you provided and the result was 9.

According to the logic of this formula, CONTAINSTRING is working properly.Is this the output you are expecting?

vcaitlynmstf_2-1646115014782.png

 


Providing the output you are expecting would be a tremendous help.
For example, if I want to get the part that contains brand A, I simply modified your formula and got the following result.

 

 

column = CALCULATE( DistinctCount( Projects[Project Number] ),FILTER( Projects, CONTAINSSTRING( Projects[Brand], "A")),FILTER( Projects, CONTAINSSTRING( Projects[Location], [Location]) ))

 

 

vcaitlynmstf_0-1646114974886.png

 

 

Best Regards,
Community Support Team _ Caitlyn

PowerBiIsFun
Frequent Visitor

Hi @Anonymous ,

 

For Project Count = CALCULATE( DistinctCount( Projects[Project Number] ),
        FILTER( Projects, CONTAINSSTRING( Projects[Brand], [Select Brand]),

        FILTER( Projects, CONTAINSSTRING( Projects[Location], [Select Location]) )

 

And having two slicers (one with the individual Brand options and the other with the individual Location options), with only "A" selected from the Brand slicer, I would expect the output of Project Count to be 2.... since both ProjectIds 1 and 2 have "A" Brand and no specific Location was chosen.

 

Thanks for your reply! I hope this helps!

 

Sarah

PowerBiIsFun
Frequent Visitor

@Anonymous 

 

I should also mention, the formula works as expected in my .pbix file but doesn't work once the file is published to our Premium Capacity workspace.  Any visuals using the measure in the reports in the workspace return an error 

PowerBiIsFun_0-1646139510878.png

 

Anonymous
Not applicable

Hi @PowerBiIsFun ,

 

Through investigation and research, we found that the same issue has been submitted internally to ICM.

(ICM: 288185073)

Feature(s) involved: Visuals start showing "couldn't load data for this visual" 

 

The product team will be investigating this issue and once any updates are available, I will sync the information for you here.

 

Best Regards,
Community Support Team _ Caitlyn