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! Request now

Reply
Anonymous
Not applicable

Different average based on filter

Delion_2-1613973827679.png

I have this data, what I want to achieve :

> Average Total : points PR+WAR from all technician

> Average PR & WAR : point only for PR OR only WAR based on FILTER

 

This is my code but gave me value :

YESTERDAY

> Average Total : correct value 7,5 this DAX gave me 3,75  (WRONG)

> Average PR & WAR : correct value PR = 3 and WAR = 4.5 this DAX gave me PR = 3 and WAR = 4.5 (CORRECT)

Bassicly how to make this DAX give a correct value for Average Total and Average PR & WAR 

 

1. AVG_Points = AVERAGE(CL_PROD[Points])

2 AVG_Points_Filter = IF(MAX(CL_PROD[WO_Type])= "PR" || MAX(CL_PROD[WO_Type])= "WAR",
	            [AVG_Points],[AVG_Points]*2)

 

1 ACCEPTED SOLUTION

Hi @Anonymous ,

Try the following formula:

AVG_Points = 
AVERAGEX(
  SUMMARIZE(
    ALLSELECTED(CL_PROD),
    CL_PROD[Tech_ID],
    "t", SUM( CL_PROD[Points] )
  ),
  [t]
)
AVG_Points_Filter = 
CALCULATE(
  AVERAGE(CL_PROD[Points]),
  ALLSELECTED(CL_PROD),
  GROUPBY(
    CL_PROD,
    CL_PROD[WO_Type]
  )
)

image.png

Does it match the output you want?

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

7 REPLIES 7
amitchandak
Super User
Super User

@Anonymous , Try a measure like

AverageX(values(Table[Date]), calculate(Sum(Table[Points])))

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

@amitchandak 

this is based on filter ?

@Anonymous , the filter should work here. Trying to get Avg on Day total

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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

@amitchandak 

 

how to upload pbix or excel here ? I can't find a feature for upload

 

@Anonymous , upload on Onedrive or dropbox and share a link

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

HI @amitchandak 

 

I share data sampel here : http://tiny.cc/2uhotz 

Hi @Anonymous ,

Try the following formula:

AVG_Points = 
AVERAGEX(
  SUMMARIZE(
    ALLSELECTED(CL_PROD),
    CL_PROD[Tech_ID],
    "t", SUM( CL_PROD[Points] )
  ),
  [t]
)
AVG_Points_Filter = 
CALCULATE(
  AVERAGE(CL_PROD[Points]),
  ALLSELECTED(CL_PROD),
  GROUPBY(
    CL_PROD,
    CL_PROD[WO_Type]
  )
)

image.png

Does it match the output you want?

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.

Best Regards,
Winniz

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

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