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! Learn more

Reply
RaffiKouzoudj
Helper III
Helper III

Calculate Average per category

Capture.PNG

 

Hello,

I want to calculate the Average (mean) of the 2020 and 2021 based on the values on the above table.

Example: (3792 + 3082 + 3337 + 3199) / 4

 

Any help!

thank You

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

You don't show the model, so I can only give you a very general formula...

 

[Measure] =
    AVERAGEX(
        DISTINCT( T[Month] ),
        [Your Base Measure]
    )

View solution in original post

v-xulin-mstf
Community Support
Community Support

Hi @RaffiKouzoudj

 

Please try measure as:

Measure = 
CALCULATE(
    AVERAGEX(DISTINCT(Sub_main [Month]),Sub_main [Total]),
    ALL('Table')
)

 

Best Regards,
Link

 

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

5 REPLIES 5
v-xulin-mstf
Community Support
Community Support

Hi @RaffiKouzoudj

 

Please try measure as:

Measure = 
CALCULATE(
    AVERAGEX(DISTINCT(Sub_main [Month]),Sub_main [Total]),
    ALL('Table')
)

 

Best Regards,
Link

 

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,

Where do you want to see the average?  In the total row or on a card visual.  Show the expected result very clearly.  Also, share the link from where i can download your PBI file.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

You don't show the model, so I can only give you a very general formula...

 

[Measure] =
    AVERAGEX(
        DISTINCT( T[Month] ),
        [Your Base Measure]
    )

Dear Daxer,

 

I used the formula you suggested however, i am getting the same values as the first column.

 

1) Total = SUM(Sub_main[2021])

2) Measure = AVERAGEX( DISTINCT(Sub_main[Month] ), Sub_main[Total]).

 

Capture.PNG

 

thank you

@RaffiKouzoudj 

maybe you can try

VAR _max=calculate(max(date),all(table))

return divide(calculate(sum(value),filter(all(table),year(date)=2021)), month(_max))





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

Proud to be a Super User!




Helpful resources

Announcements
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!

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.

Top Solution Authors