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

Help Measure designed to average a column based on the distinct values is not working

test = CALCULATE(AVERAGE(CurrentDateTable[WIPDev2]),VALUES(CurrentDateTable[WIPAvgDev]))

The goal is to take  the WIPDev2 column and average it only when there is a unique value in WIPAvgDev column.
 
This does not work however so im not sure where i went wrong.
1 ACCEPTED SOLUTION
Marc_S
Regular Visitor

I did a bit of searching and found my answer Ill leave it up for others

test = AVERAGEX(Values(CurrentDateTable[WIPAvgDev]), CALCULATE(AVERAGE(CurrentDateTable[WIPDev2])))

View solution in original post

2 REPLIES 2
TomMartens
Super User
Super User

Hey,

 

I guess this measure will do what you want:

test = 
var theValues = VALUES(CurrentDateTable[WIPAvgDev]
var NoOfValues = COUNTROWS(theValues)
return
DIVIDE(
SUMX(
    theVALUES
    , CALCULATE(AVERAGE(CurrentDateTable[WIPDev2]))
)
, NoOfValues
)

Hopefully this is what you are looking for.

 

Regards,
Tom

 

 

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Marc_S
Regular Visitor

I did a bit of searching and found my answer Ill leave it up for others

test = AVERAGEX(Values(CurrentDateTable[WIPAvgDev]), CALCULATE(AVERAGE(CurrentDateTable[WIPDev2])))

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.