cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mantjah
Helper I
Helper I

Average of most counted category

Hey, I need help here.

I am new in using power bi.

 

I have data like this:

Capture.JPG

 

I created the category using a "new column" by using the If function based on the value.

Basically what I want is, I want to create a card visual that shows only average from the largest counted category (in that case is group 2).

 

thank you

1 ACCEPTED SOLUTION
Gordonlilj
Solution Sage
Solution Sage

Hi,

 

You could use the filter on the visual to show top n category like below

Capture.PNG

 

Or if you want to create a measure you could perhaps use a code like this

 

Measure = 
CALCULATE( AVERAGE( 'Table'[Value] ),TOPN(1, VALUES( 'Table'[Category] ), 
           CALCULATE( COUNT( 'Table'[Category] ) ), DESC ))

 

 

 

 

View solution in original post

2 REPLIES 2
Gordonlilj
Solution Sage
Solution Sage

Hi,

 

You could use the filter on the visual to show top n category like below

Capture.PNG

 

Or if you want to create a measure you could perhaps use a code like this

 

Measure = 
CALCULATE( AVERAGE( 'Table'[Value] ),TOPN(1, VALUES( 'Table'[Category] ), 
           CALCULATE( COUNT( 'Table'[Category] ) ), DESC ))

 

 

 

 

View solution in original post

it works!

thank you for your help 🙏

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors