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
ssk_1984
Helper II
Helper II

Calculate column level average by multiple category

Hi Team,

 

help to add column to calculate average by multiple category.

Here i want to calculate the Average of logged hours by adding new column for the criteria, Outliers should be no, group by Employee ID & Converted month

employeeidmonthNameaccountNameconloggedhrsPTOSconverted monthcontotalProdHoursOutlierCuculate Column (Logged)
866582Nov

Abbvie PV

 

1.440.1301-Nov-230.13Yes 
866582NovAbbvie PV11.7811.5301-Nov-2311.53No7.73
866582NovAbbvie PV9.989.6601-Nov-239.66No7.73
858516NovAbbvie PV0.840.4801-Nov-230.48Yes 
858516NovAbbvie PV0.660.5901-Nov-230.59No3.33
858516NovAbbvie PV0.50.2301-Nov-230.23Yes 
866582NovAbbvie PV2.330.1301-Nov-230.13Yes 
866582NovAbbvie PV1.441001-Nov-2311.53No7.73
866582NovAbbvie PV9.810.301-Nov-239.66Yes 
858516NovAbbvie PV62.401-Nov-230.48No3.33
858516NovAbbvie PV4.50.5901-Nov-230.59Yes 
858516NovAbbvie PV3.70.2301-Nov-230.23Yes 

 

 

CriteriaCuculate Column (Logged)
OutlierNo
Group By Employee ID, Converted Month
2 REPLIES 2
ryan_mayu
Super User
Super User

@ssk_1984 

is this what you want?

Column = if('Table'[Outlier]="No",CALCULATE(AVERAGE('Table'[conloggedhrs]),ALLEXCEPT('Table','Table'[employeeid],'Table'[converted month]),'Table'[Outlier]="No"))

11.PNG





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

Proud to be a Super User!




amitchandak
Super User
Super User

@ssk_1984 , Try a new column like

 

averageX(filter(Table, [Employee ID] = earlier( [Employee ID] ) && [Converted Month] = Earlier([Converted Month]) ), [Logged])

or

if([Outlier] = "No", averageX(filter(Table, [Employee ID] = earlier( [Employee ID] ) && [Converted Month] = Earlier([Converted Month]) ), [Logged]), blank())

Power BI DAX- Earlier, I should have known Earlier: https://youtu.be/CVW6YwvHHi8
https://www.youtube.com/watch?v=cN8AO3_vmlY&t=17820s

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.