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

Make averagex to work properly with dimensions

I have my measure where I am trying to display an average... The average should change by month and of course take into account BLANKS.

 

So, if I have data:

June: 3

July: 4

August: BLANK

 

I want to see (for the selected month):

June: 3

July: 3,5 

August: 2,333

 

To achieve this I use     CALCULATE (  [Users Avg Months] ,DATESYTD('Date'[Date] ,"31/05")  )

 

It works fine with TOTALS!! ; but when I drag "user type" from  Dimension it works wrong.

 

 

My code is:

 

 

Users:=CALCULATE(SUM(Users[Actual]), FILTER('User Type', ' User Type'[C Or A] IN {"A"} ))

 

 

 

 

Users Avg Months:= AVERAGEX (   VALUES('Date'[DW_SK_Date]),[Users]  )

 

 

3 REPLIES 3
Anonymous
Not applicable

I get an error saying I cant use COALESCE. (The engine is SSAS 2019)

@Anonymous 

Try

Users Avg Months :=
AVERAGEX ( VALUES ( 'Date'[DW_SK_Date] ), [Users] + 0 )

tamerj1
Super User
Super User

Hi @Anonymous 
Please try

Users Avg Months :=
AVERAGEX ( VALUES ( 'Date'[DW_SK_Date] ), COALESCE ( [Users], 0 ) )

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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.