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
shaykoooo
Helper I
Helper I

Differenr results then expected

Hi,

In sheet "???", I have two measres, Average Quantity Sold per Day = AVERAGEX(VALUES(Dates[Date]),[Total Quantity Sold]) and Average Quantity Sold per Day 2 = AVERAGEX(VALUES(Dates[Date]),SUM(Sales[Quantity])) not returning the same result as I expect. What is the reason for that?

The measue [Total Quantity Sold] is bulit from the expression SUM(Sales[Quantity]) and that's why I assumed it would return the same results...

 

TY

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@shaykoooo

 

 

You should wrap the sum inside calculate to transform the ROW context into FILTER CONTEXT

 

Average Quantity Sold per Day 2 =
AVERAGEX ( VALUES ( Dates[Date] ), CALCULATE ( SUM ( Sales[Quantity] ) ) )

View solution in original post

2 REPLIES 2
Zubair_Muhammad
Community Champion
Community Champion

@shaykoooo

 

 

You should wrap the sum inside calculate to transform the ROW context into FILTER CONTEXT

 

Average Quantity Sold per Day 2 =
AVERAGEX ( VALUES ( Dates[Date] ), CALCULATE ( SUM ( Sales[Quantity] ) ) )

And in the first measure there is no need to wrap the measure [Total Quantity Sold] there is no need to with CALCULATE since measures have an Implicit CALCULATE?

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.

Top Solution Authors
Top Kudoed Authors