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
Seth4040
Regular Visitor

Average based on Filter

I am trying to get the average of project completions per week and then when I am changing the filter as what weeks I am seeing that the average would be tied into this filter.  It is currently do the completion average for all the data which is this. 

Average = CALCULATE(COUNT('CP Jobs'[Project]),ALL('CP Jobs'))/CALCULATE(DISTINCTCOUNT('CP Jobs'[Year-Wk]),ALL('CP Jobs'))

 

Screenshot 2025-02-25 at 8.30.30โ€ฏAM.png

Screenshot 2025-02-25 at 8.31.24โ€ฏAM.png

โ€ƒ

โ€ƒ

2 REPLIES 2
sanalytics
Super User
Super User

@Seth4040 
Can you use below code and see if it is working or not.. if not then requesting you to provide some dummy data along with your desired output.

Average Value = 
VAR FilteredValues = 
    CALCULATETABLE(
        VALUES(Table[Value]), 
        ALLSELECTED(Table)
    )

RETURN 
    AVERAGEX(FilteredValues, Table[Value])

Regards,

sanalytics

adgeku7
Frequent Visitor

I think the use of ALL() is creating your problem - ALL() ingnores any filters applied at the page or visualization level (example, when you select a week filter, it gets ignored).

 

Try:

Average = CALCULATE(COUNT('CP Jobs'[Project]))/CALCULATE(DISTINCTCOUNT('CP Jobs'[Year-Wk]))

 

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric 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.

Users online (27)