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

How to measure a average of the count rows?

Hi guys,

 

I have the following table

 

ExaminationID          Req_id

233313                      1

233455                      1

233123                      1

333421                      1

445531                      2

234553                      2

993030                      2

837782                      3

474875                      3

677793                      4

 

currently i have a measure that count the examinationId per Req_id (=COUNT(ExaminationID). With this measure i can show for example that req_id have 4 examinations and req_id has 3 examinations and so  on.....

 

Now i need your help how to make a measure that gives a average of the counted rows.  Which formula should i use?

 

Thanks for your help!

 

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @Anonymous,


You can try to use 'summarize' function to summary count of 'examinationid', then use 'averagex' function to calculate on this new column.

 

Sample:

Measure = AVERAGEX(SUMMARIZE('sample',[Req_id],"Count",COUNT('sample'[ExaminationID])),[Count])

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

Hi @Anonymous,


You can try to use 'summarize' function to summary count of 'examinationid', then use 'averagex' function to calculate on this new column.

 

Sample:

Measure = AVERAGEX(SUMMARIZE('sample',[Req_id],"Count",COUNT('sample'[ExaminationID])),[Count])

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Greg_Deckler
Super User
Super User

I may be completely off-base with this, but the average of the counts should equal the average of it all together.

 

If I have 10 rows and 4 unique things, then the average is always going to be 2.5. 

 

Since the average is always just the sum divided by the number of items, then since you are just counting rows you would just take the count of ALL divided by the distinct count of the req_id. 


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.