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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
sigridr
Helper I
Helper I

Largest average dviation per product in a column

Hi, 

 

I have a (large) table that looks something like this: 

In this random example, the average weight deviations are: 

Product A: +2,2 % // 

Product B: +3,6 % // 

Product C: -0,33 % 

 

I need a measure to, in this case, pick put "Product B" for the largest average weight deviation. 

Any suggestions? 

 

ProductWeight Actual weight Deviation 
Product A  +1 % 
Product B  +3,2 % 
Product C   + 0,4 % 
Product A  + 5 %
Product B  + 2,9 %
Product C   - 0,4 %
Product A  + 0,6 % 
Product B  + 4,7 %
Product C   -1 % 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sigridr ,

Please have a try.

Create measures.

 

 

Measure = AVERAGEX(FILTER(ALL('Table'),'Table'[Product]=SELECTEDVALUE('Table'[Product])),'Table'[Weight Actual])
measure2=maxx(all(table),[measure])

 

 

Or a column.

 

 

column = AVERAGEX(FILTER(ALL('Table'),'Table'[Product]=EARLIER('Table'[Product])),'Table'[Weight Actual])

 

 

 

measure=maxx(all(table),table[column])

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

3 REPLIES 3
Anonymous
Not applicable

Hi @sigridr ,

Please have a try.

Create measures.

 

 

Measure = AVERAGEX(FILTER(ALL('Table'),'Table'[Product]=SELECTEDVALUE('Table'[Product])),'Table'[Weight Actual])
measure2=maxx(all(table),[measure])

 

 

Or a column.

 

 

column = AVERAGEX(FILTER(ALL('Table'),'Table'[Product]=EARLIER('Table'[Product])),'Table'[Weight Actual])

 

 

 

measure=maxx(all(table),table[column])

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Polly

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

sigridr
Helper I
Helper I

I think I can do it with this formula: 

MaksProd = VAR MaxAvProd =
 MAX ( 'Table'[AverageWeight] )
RETURN
 CALCULATE (
 SELECTEDVALUE ( 'Table'[ProductName] ),
 'Table'[AverageWeight] = MaxAvProd
 )


But then I just need to create a column with the averages per product (that shows the value 2,2 for each row with product A and so on.. ) 
hmm...

I tried this: 

Kolonne =
AVERAGEX(
    KEEPFILTERS(VALUES('Table'[ProductName])),
    CALCULATE(AVERAGE('Table'[Weightdifference]))


But then I get a circular dependency issue.... :'( 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.