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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
andrelopes2711
Frequent Visitor

How to Calculate Average of CountRows per Manager and Display on All Rows

Good afternoon everyone, I need help solving this problem. In the first column of the print, I created a measure called countrows. Based on this, I need to create a new measure with the average of these countrows per manager and return this average for all rows, not just the total row. Later, I'll create a lighthouse where I need to use this average. Also, here's the measurement I tried to create for this average, but it didn't work.

average_teste = 

CALCULATE(

AVERAGEX(

FILTER(

VALUES(Fat_ate_cambios_Estados_envio[USER_TEAM_LEADER_LDAP]),

NOT ISBLANK([#Casos_cambios_estados_envio])

&& [#Casos_cambios_estados_envio] <> 0

),

[#Casos_cambios_estados_envio]

),

KEEPFILTERS(

ALLEXCEPT(

Fat_ate_cambios_Estados_envio,

Fat_ate_cambios_Estados_envio[USER_TEAM_NAME]

)

)

)

 

Captura de tela 2025-10-21 180738.png

1 ACCEPTED SOLUTION

Hi @andrelopes2711 ,

Thank you for the update. I have replicated from my side. It is working from my side. Please check from your side like any filters or any other need to change? Please refer below output snap and attached PBIX file.

 

vdineshya_0-1761292830408.png

 

I hope this information helps. Please do let us know if you have any further queries.

 

Regards,

Dinesh

View solution in original post

6 REPLIES 6
Praful_Potphode
Impactful Individual
Impactful Individual

Hi @andrelopes2711 ,

Please try below measure:

average_teste = IF(
    ISINSCOPE(Fat_ate_cambios_Estados_envio[USER_TEAM_LEADER_LDAP]),
   
AVERAGEX(
    Fat_ate_cambios_Estados_envio,
    [#Casos_cambios_estados_envio]
)
,BLANK()
)

above measure will show blank if the total row is selected and it will show value when the USER_TEAM_LEADER_LDAP is selected.this is used a lot for matrix visuals.

 

Please give kudos or mark it as solution once confirmed.

 

Thanks and Regards,

Praful

v-dineshya
Community Support
Community Support

Hi @andrelopes2711 ,

Thank you for reaching out to the Microsoft Community Forum.

 

As you mentioned your previous post, you need to create a new measure with the average of  countrows per manager and return this average for all rows, not just the total row. Please refer below sample data snap.

 

vdineshya_0-1761131203857.png

 

Please refer below DAX measure, ouput snap and PBIX file.

 

vdineshya_1-1761131277555.png

 

I hope this information helps. Please do let us know if you have any further queries.

 

Regards,

Dinesh

Good afternoon @v-dineshya and @Praful_Potphode , I included the suggestion but it is returning the average even for cases where there are no values ​​in [#Casos_cambios_estados_envio] and the average is also not correct, taking the example of BR_MED_PNRME_Offline and for 09/01/2025 the values ​​are 12, 9, 7, 4, 2, 2 and the average of this should be 6 but it is returning 2, I changed the measurement instead of ALL to AllSelected but it did not work. =/

Attached is the pbix I am using and the relationships used.

 

https://drive.google.com/file/d/1ESH1_1POO7fqY0Ys6I-MiVBGfXT0QB-M/view?usp=sharing 

Hi @andrelopes2711 ,

Thank you for the update. I have replicated from my side. It is working from my side. Please check from your side like any filters or any other need to change? Please refer below output snap and attached PBIX file.

 

vdineshya_0-1761292830408.png

 

I hope this information helps. Please do let us know if you have any further queries.

 

Regards,

Dinesh

Hi @andrelopes2711 ,

We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. And, if you have any further query do let us know.

 

Regards,

Dinesh

PhilipTreacy
Super User
Super User

Hi @andrelopes2711 

Please supply your PBIX file or some sample data we can work with.

Regards

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors