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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
safetyfirst
New Member

Count/average based on another column

I'm trying to calculate the number of inspector observations per report name. With this I want to calculate the average number of observations per name at inspection. Is this possible?

 

Report NameName at InspectionInspector Observations
XXXX-XXXX-XXXX-XXXXLibertyA
XXXX-XXXX-XXXX-XXXXLibertyD
XXXX-XXXX-XXXX-XXXYFreedomA
XXXX-XXXX-XXXX-XXXYFreedomB
XXXX-XXXX-XXXX-XXXYFreedomC
XXXX-XXXX-XXXX-XXXZLibertyB
XXXX-XXXX-XXXX-XXXZLibertyC
XXXX-XXXX-XXXX-XXXZLibertyD
5 REPLIES 5
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @safetyfirst,

>>I'm trying to calculate the number of inspector observations per report name. 

You can create a table visual, select the report name and count of Inspector Observations as values, or you can create a new table by clicking "New Table" under Modeling on Homepage. Please review the picture1 and picture2.

Table = SUMMARIZE(Table2,Table2[Report Name],"the number of inspector observations",COUNTA(Table2[Inspector Observations]))

picture1picture1picture2picture2
>>I want to calculate the average number of observations per name at inspection.

You use the same way as above, select Average of Inspector Observations, or create a new table as follows.

Measure 2 = DIVIDE(DISTINCTCOUNT(Table2[Inspector Observations]),COUNTA(Table2[Name at Inspection]))

picture3picture3

Create a new table.

Table 2 =
SUMMARIZE (
    Table2,
    Table2[Name at Inspection],
    "Average of Inspector Observations", DIVIDE (
        DISTINCTCOUNT ( Table2[Inspector Observations] ),
        COUNTA ( Table2[Name at Inspection] )
    )
)


3.png

Please let me know if this is not what you want.

Best Regards,
Angelia

 

Thank you @v-huizhn-msft! I believe this is just what I'm looking for, but it is calculating the averages as 1 using both methods.

 

Any idea why this may be? Some of the reports do have the same observation if this affects the calculation.

 

Thanks for your help.

Hi @safetyfirst,

Could you please mark the reply as answer if you think it's useful, so more people will benefit from here.

Best Regards,
Angelia

Hi @safetyfirst,

>>but it is calculating the averages as 1 using both methods

Actually, I can't understand your problem, could you please describe it in details?

Best Regards,
Angelia

Greg_Deckler
Community Champion
Community Champion

So what are your expected results from the example data?



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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