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
Anonymous
Not applicable

Calculate Average based on several filters from different columns

I have this table that I need to get the average of Days, from 1 department AND 3 roles.

 

For example, I need to get the Days Average of P&E between SVP, VP and Exec.Director only.

I tried using the CALCULATE to create a measure, but I just can't seem to put in the correct filters or expression in the measure. Appreciate the help. Here is a sample of the data.

 

I will use this like a standard bar for average, that would not change regardless of the filters chosen in a page

 

Nogstai_0-1651753219949.png

 

 

 

6 REPLIES 6
v-jingzhang
Community Support
Community Support

Hi @Anonymous 

 

You can try this measure

Average Value =
CALCULATE (
    AVERAGE ( 'TableName'[Days] ),
    FILTER (
        ALL ( 'TableName' ),
        'TableName'[Department] = "P&E"
            && 'TableName'[Role] IN { "SVP", "VP", "Exec.Director" }
    )
)

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

PC2790
Community Champion
Community Champion

You can try something like:

CALCULATE(AVERAGE([DAYS]),FILTER(<TableName>,<logic based on which filter is to be applied>))
Anonymous
Not applicable

Should I use the AND() logic on different tables? Sorry I tried using this awhile ago and the filter is not getting the values

PC2790
Community Champion
Community Champion

CALCULATE DAX allows you to have multiple Filters that too you can have on different tables. something like:

 

..............,FILTER(Orders,Orders[Amount]=1),FILTER(Suppliers,Suppliers[Country]= "EUROPE"))
Anonymous
Not applicable

Sorry, I meant different columns.

CALCULATE
(AVERAGE([DAYS]), FILTER(Table1, Table1[Department]="P&E"), FILTER(Table1, Table1[Role]="SVP"), FILTER(Table1, Table1[Role]="VP"), FILTER(Table1, Table1[Role]="Exec.Director")
 
This one is not working. I tried it, and it's not showing any data (the dark blue one)
 
Nogstai_0-1651758723857.png

 

PC2790
Community Champion
Community Champion

This should work:

CALCULATE(AVERAGE(Table1[DAYS]),FILTER(Table1,Table1[Department] in {"P&E","SVP","VP","Exec.Director"}))

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