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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

DAX expression for everything else or rest of (with slicer)

Hi Everyone,


Still new to Power BI and getting better at DAX but this one stumps me.  For hours.  And hours.  Please someone smarter than me help!

 

Desired outcome:

Determine the number of orders per month by region for my organization, the entire brand (including me), and everyone in the entire brand (excluding me).  I have solved the first two but cannot create correct DAX for orders for everyone in the entire brand except me.

 

My Data:

I have a table called 'Door_Dash2'. 

I have created a many to one relationship with 'Door_Dash2' [Site Number]  to 'Store Attributes' [Unit Number].

 

My slicer:

I have a slicer using the 'Store Attributes'[Number/Region] field.  This allows me to switch between nine different regions. 

 

Good Measures (Measures that work with slicer):

 

 

Orders Avg My Organization= 
CALCULATE(
	AVERAGE('Door_Dash2'[Orders]),
	'Door_Dash2'[                                Combination Name]
		IN { "MY ORGANIZATION" }
)

that works.  this works too:

 

 

 

Orders Avg ALL INCLUDING MY ORGANIZATION = 
CALCULATE(
    AVERAGE('Door_Dash2'[Orders])
    ,ALL('Door_Dash2'[      Site  Number])
    ,ALL('Store Attributes'[Number/Region]
))

 

Bad measure (Measure that does not work with slicer):

 

but i can't figure out how to write DAX for average orders for all, excluding my organization.

 

 

What I tried:

 

 

Orders Avg ALL EXCLUDING MY ORGANIZATION = 
CALCULATE(
	AVERAGE('Door_Dash2'[Orders]),
   'Door_Dash'[                                Combination Name]
		<> { "MY ORGANIZATION" }
)

This returns the same value as Orders Average My Organization.

 

 

I suspect this is because the slicer of 'Store Attributes'[Number/Region].

 

The issue with my data is that not every 'Door_Dash2'[         Site  Number] has a'Store Attributes'[Number/Region].

 

This is because I do not own all the stores in 'Door_Dash2'.  There are other organizations who own sites.

 

Summary:

In summary, I need a DAX expression that calculates the average orders for all sites, excluding my sites filtered by region using my slicer.

 

Sample data:

 

https://docs.google.com/spreadsheets/d/1ghXDw_l2h_B0MeNffUZtFdiy-AInsMk15RoIqQNIsHU/edit?usp=sharing

 

Thanks so much for looking at this!

1 ACCEPTED SOLUTION

Hi @Anonymous,

Thanks for your understanding and if your problem could be closed, could you please mark the reply as Answered?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

12 REPLIES 12

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.