cancel
Showing results for
Did you mean:
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.

Hope I'm explaining this correctly.

4 REPLIES 4
Community Support

Hi @semiitpro ,

Is this what you want?

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.

Helper I

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

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] )``

Best Regards,
Icey

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

Frequent Visitor

Hi @semiitpro ,

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

Announcements

#### 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.

#### Microsoft named a Leader in The Forrester Wave

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

#### 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 Solution Authors
Top Kudoed Authors