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
Anonymous
Not applicable

Comparing a value to the values total based on a matching dimension.

Hi everyone,

 

In my example, I have 4 unique stores with different store types (small, medium and large format). 

To see if a store performs better or worse than the average of similar store formats, I wants to add a column (marked red in example below) that keeps the average of all the stores with similar format.  So in my example below, the average of large store formats is 100 (=(50+150)/2).

When I have slicers in place, I somehow cant figure out how I can fix this. Can anyone help me? Thanks so much in advance!

 

Example:

Store IDStore formatAverage revenueAverage of store classification
1Small1010
2Medium2025
3Large50100
4Large

150

100

5Medium

30

25

 

 

 

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Anonymous Try:

 

Measure = 
  VAR __Format = MAX('Table'[Store format)
  VAR __Table = FILTER(ALL('Table'),[Store format] = __Format)
  VAR __Result = AVERAGEX(__Table,[Average revenue])
RETURN
  __Result

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Anonymous Try:

 

Measure = 
  VAR __Format = MAX('Table'[Store format)
  VAR __Table = FILTER(ALL('Table'),[Store format] = __Format)
  VAR __Result = AVERAGEX(__Table,[Average revenue])
RETURN
  __Result

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Hi @Greg_Deckler ,

 

[edit] It worked! Thanks for the quick reply and solution. Really helpful! 😄
Thanks for your reply! I have used your answer, but it seems it returns the average revenue per row, and not the average of multiple rows in that new column. So the revenue value stays the same. 

Im not quite following the steps in the measure example. What does the MAX('Table'[Store format]) do in this example?

Again, thanks for taking the time, I really appreciate it 🙂

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.