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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.