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

average of column values depending upon the duplicate entries in another column

Hi All,

 

need some help on calculating avg of values depending upon duplicates in another 2 columns

 

i have a table fetched via api . now the table has multiple columns 

i am trying to create a measure/column that can remove the duplicacy and generate avg so that overall rows can be reduced.

 

for example -

Column 1   Column 2  Column3

A                CT               0.22

A                CT                0.34

B                CT               0.23

B               TR                0.11

B                TR                0.14

C              ED                0.25

C              TR                0.14

 

im looking for below output

Column1  Column2   Column2 

A                CT         avg of(0.22,0.34)

B                 CT        0.23

B                TR       avg of(0.11,0.14)

and so on

1 ACCEPTED SOLUTION
v-xulin-mstf
Community Support
Community Support

Hi @Anonymous,

 

Try measure as:

Measure =

CALCULATE(

   AVERAGE('Table'[Column3]),

   FILTER(

       ALL('Table'),

       'Table'[Column2]=MAX('Table'[Column2])&& 'Table'[Column1]=MAX('Table'[Column1])

   )

)

 Here is the output:

v-xulin-mstf_0-1611911727990.png

 

Here is the demo, please try it: average of column values depending upon the duplicate entries in another column

 

Best Regards

Link

 

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

1 REPLY 1
v-xulin-mstf
Community Support
Community Support

Hi @Anonymous,

 

Try measure as:

Measure =

CALCULATE(

   AVERAGE('Table'[Column3]),

   FILTER(

       ALL('Table'),

       'Table'[Column2]=MAX('Table'[Column2])&& 'Table'[Column1]=MAX('Table'[Column1])

   )

)

 Here is the output:

v-xulin-mstf_0-1611911727990.png

 

Here is the demo, please try it: average of column values depending upon the duplicate entries in another column

 

Best Regards

Link

 

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

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
Top Kudoed Authors