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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

DAX Measure help

Hi,

 

I am trying to get all measures shown based on selection, I had trouble to show what I needed as the slicer or filter exclude all other records that I need.

What I want to do:

If a select shop B, I want to show, profit of the selected shop, compare to average in its region and compare to average in its state. 

Desired result:

Shop B: $150
average of region 1 in CA = (100+150+230)/3 = $160
average of CA $205

Any help is much appreciated.

Excel.PNG

1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @Anonymous ,

 

We can use two measures to meet your requirement. One calculates the average of region, another calculates the average of state.

 

average of region = 
CALCULATE (
    AVERAGE ( 'Table'[Profit] ),
     ALLSELECTED ( 'Table' ), ALL ( 'Table'[Shop] ) ,
    'Table'[Region] IN DISTINCT ( 'Table'[Region] ),
    'Table'[State] IN DISTINCT ( 'Table'[State] )
)

 

average of State = 
CALCULATE (
    AVERAGE ( 'Table'[Profit] ),
    ALLSELECTED ( 'Table' ), ALL ( 'Table'[Shop] ) ,
    'Table'[State] IN DISTINCT ( 'Table'[State] )
)

 

The result like this,

 

DAX 1 .jpg

 

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

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

2 REPLIES 2
v-zhenbw-msft
Community Support
Community Support

Hi @Anonymous ,

 

We can use two measures to meet your requirement. One calculates the average of region, another calculates the average of state.

 

average of region = 
CALCULATE (
    AVERAGE ( 'Table'[Profit] ),
     ALLSELECTED ( 'Table' ), ALL ( 'Table'[Shop] ) ,
    'Table'[Region] IN DISTINCT ( 'Table'[Region] ),
    'Table'[State] IN DISTINCT ( 'Table'[State] )
)

 

average of State = 
CALCULATE (
    AVERAGE ( 'Table'[Profit] ),
    ALLSELECTED ( 'Table' ), ALL ( 'Table'[Shop] ) ,
    'Table'[State] IN DISTINCT ( 'Table'[State] )
)

 

The result like this,

 

DAX 1 .jpg

 

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , Try a new measure like

avergageX(summarize(Table,Table[Shop],"_1",sum(Table[profit])),[_1])

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

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors