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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jmars808
Microsoft Employee
Microsoft Employee

How to exclude Items from nested DAX using multiple formulas?

Current working formula I want to exclude 4 items from:

 

Best in Class Top 5 Average = CALCULATE(AVERAGEX(TOPN(5, SUMMARIZE(filter(all(Company),Company[Segment]="SMB"),[Company Name],"NROI", [Item Value]),[Item Value],DESC),[Item Value]),all('Global Region'))

 

I need to exclude 4 different Company Names from the total list of companies in the SMB Segment. I need to exclude Company A, Company B, Company C, and Company D. Right now it is taking the top 5 average from all Company Names. I need to to take the top 5 avg from all except these 4. 

 

How do I write the syntax properly so this works? I assume something with Company Name <> "Company A", Company Name <> "Company B", etc. Not sure where to properly exclude these. Tried ALLEXCEPT but that didnt work. Stuck here on how to write this...

 

Thanks!!
(DAX Novice) 🙂 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@jmars808 , Try like

Best in Class Top 5 Average = CALCULATE(AVERAGEX(TOPN(5, SUMMARIZE(filter(all(Company),Company[Segment]="SMB" && not( [Company Name] in {"Company A", "Company B", "Company C", "Company D"})),[Company Name],"NROI", [Item Value]),[Item Value],DESC),[Item Value]),all('Global Region'))

 

If you want to exclude on measure and not in other. create those two separately and then use in this formula

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

@jmars808 , Try like

Best in Class Top 5 Average = CALCULATE(AVERAGEX(TOPN(5, SUMMARIZE(filter(all(Company),Company[Segment]="SMB" && not( [Company Name] in {"Company A", "Company B", "Company C", "Company D"})),[Company Name],"NROI", [Item Value]),[Item Value],DESC),[Item Value]),all('Global Region'))

 

If you want to exclude on measure and not in other. create those two separately and then use in this formula

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

@amitchandak Thank you!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.