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

Reply
Anmolgan
Post Prodigy
Post Prodigy

Filter out value from a DAX measure?

I want to write a dax formula for calculating volume, by filtering out sales group 011, 010, 009.

 

After that I want to filter out below values from the above mesaure:

 

filter out customername and below are my customer name that I want to filter out and also fiter out 010.

 

Filter out

Customer A

Customer B

 

How to write this dax in order to get correct result?

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

@Anmolgan 

In your statement above you are INcluding all values by sales group

try

Measure = CALCULATE(SUM(ZSD_MAT_MARGIN_Q003[Sales Volume KL]), FILTER(ZSD_MAT_MARGIN_Q003, 
(ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01]= "011" || ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01.Key]= "010" || ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01.Key]= "009") && [Customer] <> "Value A" && [Customer] <> "Value B"
))

do not hesitate to give a kudo to useful posts and mark solutions as solution

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

5 REPLIES 5
az38
Community Champion
Community Champion

Hi @Anmolgan 

data model is not clear from your definition, but try something like 

Measure =
CALCULATE(
SUM([Value]);
FILTER(ALL('Table');NOT ('Table'[Sales Group] IN {"009","010","011"}) && NOT('Table'[Sales Group] IN {"Customer A","Customer B"}))
)

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

@az38  I had created below measure for filtering out sales group 

Measure = CALCULATE(SUM(ZSD_MAT_MARGIN_Q003[Sales Volume KL]), FILTER(ZSD_MAT_MARGIN_Q003, ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01]= "011" || ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01.Key]= "010" || ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01.Key]= "009"))
 
How can add my defenation here which says, do not include values that comes in customer table:
 
Value A
Value B
az38
Community Champion
Community Champion

@Anmolgan 

does your table ZSD_MAT_MARGIN_Q003 have a relationship with Customer table?

If so, it could be enough to add in filter statement || RELATED([Customer]) = "Value A" like this

Measure = CALCULATE(SUM(ZSD_MAT_MARGIN_Q003[Sales Volume KL]), FILTER(ZSD_MAT_MARGIN_Q003, ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01]= "011" || ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01.Key]= "010" || ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01.Key]= "009" || RELATED('Customer Table'[Customer]) = "Value A" || RELATED('Customer Table'[Customer]) = "Value B"))

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

@az38  Everything is present in my table, I only have 1 table, why I should use RELATED I dont want to include those values in my existing dax, I want to exclude those values.

az38
Community Champion
Community Champion

@Anmolgan 

In your statement above you are INcluding all values by sales group

try

Measure = CALCULATE(SUM(ZSD_MAT_MARGIN_Q003[Sales Volume KL]), FILTER(ZSD_MAT_MARGIN_Q003, 
(ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01]= "011" || ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01.Key]= "010" || ZSD_MAT_MARGIN_Q003[Sales group.Sales group Level 01.Key]= "009") && [Customer] <> "Value A" && [Customer] <> "Value B"
))

do not hesitate to give a kudo to useful posts and mark solutions as solution

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors