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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
nesrinehal20
Frequent Visitor

CA Moyen Dax

how to calculate average CA for each representative, I have representative code and invoice number and ca as data

is this code right :  

CA_Moyen_Par_Representant =
DIVIDE(
    SUM(data[CA]),
    COUNTROWS(SUMMARIZE('data', 'data'[NUM_FAC], 'data'[COD_REP]))
)
2 ACCEPTED SOLUTIONS
audreygerred
Super User
Super User

Hi! You can use a quick measure. First, make your base measure; Total CA = SUM ('YourTable'[CA]). Next, open quick measures, click the drop down and select average per category. In the base value, put the Total CA measure. In Category put your field for representatives. This will give you average per rep.

 

Here is one I did with sample data based on average sales per country:

Sales Amount average per Country =
AVERAGEX(
    KEEPFILTERS(VALUES('Sales Territory'[Country])),
    CALCULATE([Sales Amount])
)
 
audreygerred_0-1729720441272.png

 

 
 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

Anonymous
Not applicable

Hi @nesrinehal20 ,

 

Maybe you can try formula like below:

CA_Moyen_Par_Representant =
DIVIDE (
    CALCULATE ( SUM ( data[CA] ), ALLEXCEPT ( data, data[COD_REP] ) ),
    CALCULATE ( COUNTROWS ( data ), ALLEXCEPT ( data, data[COD_REP] ) )
)

vkongfanfmsft_0-1729762901298.png

 

Best Regards,
Adamk Kong

 

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

3 REPLIES 3
Anonymous
Not applicable

Hi @nesrinehal20 ,

 

Maybe you can try formula like below:

CA_Moyen_Par_Representant =
DIVIDE (
    CALCULATE ( SUM ( data[CA] ), ALLEXCEPT ( data, data[COD_REP] ) ),
    CALCULATE ( COUNTROWS ( data ), ALLEXCEPT ( data, data[COD_REP] ) )
)

vkongfanfmsft_0-1729762901298.png

 

Best Regards,
Adamk Kong

 

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

Ashish_Mathur
Super User
Super User

Hi,

Share some data to work with and show the expected result.  Share data in a format that can be pasted in an MS Excel file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
audreygerred
Super User
Super User

Hi! You can use a quick measure. First, make your base measure; Total CA = SUM ('YourTable'[CA]). Next, open quick measures, click the drop down and select average per category. In the base value, put the Total CA measure. In Category put your field for representatives. This will give you average per rep.

 

Here is one I did with sample data based on average sales per country:

Sales Amount average per Country =
AVERAGEX(
    KEEPFILTERS(VALUES('Sales Territory'[Country])),
    CALCULATE([Sales Amount])
)
 
audreygerred_0-1729720441272.png

 

 
 




Did I answer your question? Mark my post as a solution!

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