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
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
v-rongtiep-msft
Community Support
Community Support

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
v-rongtiep-msft
Community Support
Community Support

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
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.

Top Solution Authors