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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
Anonymous
Not applicable

Exclude certain string values

Hi, 
I am a Qlikview developer that has been working a lot with PBI lately.

 

I have a case were I want to calculate "Number of Answered Emails" and exclude all rows where column Workgroup includes GDPR string. 


As an example the workgroups can be Arket_Austrian_GDPR_Emails and we have a lot of these kind of values that contains GDPR. 

Is there any best practice for these kind of calculations? I have a lot of calculations that needs the same treatment in terms of excluding multiple string values.

 

I have tried creating a metric for this, see below:

Contact per Order % =
VAR IFGDPR = IF(
                SEARCH("*Ar*",MAX(dim_brand[Brand]),1,BLANK())>=1
                    ,1
                        ,0 )
VAR NoEmails = CALCULATE([No of Emails], dim_wrapup[Wrap Up Group] <> "BO Action", dim_wrapup[Wrap Up Group] <> "BO Support", dim_wrapup[Wrap Up Group] <> "H&M CLUB", IFGDPR = 0 )
RETURN
NoEmails

 

FYI, No of Emails are already aggregated in a SUM function in a measure before.

 

BR Fredrik

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try like

 

CALCULATE([No of Emails], Filter( dim_wrapup , not( dim_wrapup[Wrap Up Group] in {"BO Action", "BO Support", "H&M CLUB" })) , filter( dim_brand, SEARCH("*Ar*",dim_brand[Brand],1,0) = 0 ) )

 

 

Check this too

http://dataap.org/blog/2019/04/22/difference-between-calculate-with-and-without-filter-expression/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try like

 

CALCULATE([No of Emails], Filter( dim_wrapup , not( dim_wrapup[Wrap Up Group] in {"BO Action", "BO Support", "H&M CLUB" })) , filter( dim_brand, SEARCH("*Ar*",dim_brand[Brand],1,0) = 0 ) )

 

 

Check this too

http://dataap.org/blog/2019/04/22/difference-between-calculate-with-and-without-filter-expression/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak 
Hi,

 

Thanks for the reply! 
Your solution was exactly what I was looking for. This actually made me understand so much more about DAX and how to think... 

 

DAX vs Qlik is very different in terms of logic in some cases and this helped me. I had a lot of cases were I needed to do filtering of this kind in some key metrics.

 

Have nice day! 

 

BR Fredrik

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.