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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
sadsmileyface
Regular Visitor

Can I find the Average of values in a column using a calculated column rather than a measure?

Would it be possible to create a caluclated column that could find the average of each salesmans sales so that looks a little like this example?

 

DaySalesmanSalesAverage
MondayJohn200277.5
MondaySteve350625
MondayBilly100170
TuesdayJohn355277.5
TuesdaySteve900625
TuesdayBilly240170

 

I know I could format the a total to show the average in a visual and I have a measure that does the same thing, but I was wondering if I could do this in a calulated column? 

1 ACCEPTED SOLUTION
ppm1
Solution Sage
Solution Sage

Please try this column expression. Replace T1 with your actual table name.

AvgSales =
CALCULATE (
    AVERAGE ( T1[Sales] ),
    ALLEXCEPT ( T1, T1[Salesman] ),
    T1[Sales] > 0
)

Pat

Microsoft Employee

View solution in original post

4 REPLIES 4
ppm1
Solution Sage
Solution Sage

Please try this column expression. Replace T1 with your actual table name.

AvgSales =
CALCULATE (
    AVERAGE ( T1[Sales] ),
    ALLEXCEPT ( T1, T1[Salesman] ),
    T1[Sales] > 0
)

Pat

Microsoft Employee

Outstanding, that's cracked it! You two have been brilliant help! 

PhilipTreacy
Super User
Super User

Hi @sadsmileyface 

 

Try this

 

Avg = CALCULATE(AVERAGEX('DataTable','DataTable'[Sales]), FILTER('DataTable', 'DataTable'[Salesman] = EARLIER('DataTable'[Salesman])))

 

 

PhilipTreacy_0-1668734076653.png

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Oh that is fantastic! Would you know how I could exclude any values that were 0 and / or blanks? 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.