cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
semiitpro
Helper I
Helper I

Average by month for a dimension measure

Best way to explain this is with an example.

 

For sales, the grain is the line item transaction.  These are associated with an order dimension and these orders have a fulfillment metric for the days between order placed and order fulfilled.

 

The transaction table has the order date tied to the master calendar.  When I created a measure AVERAGE(ORDERS[Days to Fulfillment])) I can get the overall average but when I add in the order date month, it shows this same overall average for each month.  I need the average fulfillment days for each month based on order date.

Capture.PNG

 

 

 

 

 

 

 

Hope I'm explaining this correctly.

4 REPLIES 4
Icey
Community Support
Community Support

Hi @semiitpro ,

Is this what you want?

sum.PNG

If so, create your measure like so:

Average of fulfillment days 2 =
AVERAGEX (
    'FACT',
    DATEDIFF ( 'FACT'[Order date], 'FACT'[Complete date], DAY ) + 1
)

PBIX file attached.

 

Best Regards,
Icey

 

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

No - jan has two orders of 15 & 7 days so the average is 15+7/2 = 11.  Where are you getting 11.57 ?

Icey
Community Support
Community Support

Hi @semiitpro ,

Try this:

DateDiff of day +1 = DATEDIFF ( MAX ( 'FACT'[Order date] ), MAX ( 'FACT'[Complete date] ), DAY ) + 1
Average = AVERAGEX ( VALUES ( 'FACT'[Order] ), [DateDiff of day +1] )

 average.PNG

 

Best Regards,
Icey

 

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

DS12345
Frequent Visitor

Hi @semiitpro ,

 

I think the solution to your problem is explained in this article:

 

https://community.powerbi.com/t5/Desktop/Calculate-an-average-from-a-Sum-by-Month/td-p/27250

Helpful resources

Announcements
PBI_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Get Ready for Power BI Dev Camp

Microsoft named a Leader in The Forrester Wave

Microsoft received the highest score of any vendor in both the strategy and current offering categories.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Top Kudoed Authors