Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
HFoy
Frequent Visitor

Average a measure across whole month and input for each date in month

 

Hi All, 

 

I have a measure: 

fc_Delivery_Rate = CALCULATE([Actual_Delivery], SAMEPERIODLASTYEAR('Calendar'[Date]))
 
This gives me the delivery rate (actual delivery = what was actually delivered/  what was requested )  for the previous year for each date of 2019/20. I want to be able to take the average delivery across each month and apply that value to every date in the month. A short example is given in the image. I want to be able to create the Avg_Month_Delivery, any help would be apprecaited.
 
Thanks,
Hannah
Capture2.PNG
1 ACCEPTED SOLUTION
AlB
Super User
Super User

Hi @HFoy,

I'd need to see the relationships in your model and the structure of your tables to come up with an accurate answer. You should show that. Assuming the most typical structure, you could create a measure like this:

 

Measure =
AVERAGEX (
    ADDCOLUMNS (
        FILTER (
            ALL ( 'Calendar'[Date] ),
            YEAR ( 'Calendar'[Date] ) = YEAR ( SELECTEDVALUE ( Table1[Date] ) )
                && MONTH ( 'Calendar'[Date] ) = MONTH ( SELECTEDVALUE ( Table1[Date] ) )
        ),
        "_Day", [fc_Delivery_Rate]
    ),
    [_Day]
)

Please always show your sample data in text-tabular format in addition to (or instead of)  screen captures. That allows people trying to help to readily copy the data and run a quick test, plus it increases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).

 

 

View solution in original post

2 REPLIES 2
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @HFoy ,

Have you solved your problem?

If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

If you still need help, please share your data sample which could reproduce your scenario and your desired output so that we could help further on it.

Best Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
AlB
Super User
Super User

Hi @HFoy,

I'd need to see the relationships in your model and the structure of your tables to come up with an accurate answer. You should show that. Assuming the most typical structure, you could create a measure like this:

 

Measure =
AVERAGEX (
    ADDCOLUMNS (
        FILTER (
            ALL ( 'Calendar'[Date] ),
            YEAR ( 'Calendar'[Date] ) = YEAR ( SELECTEDVALUE ( Table1[Date] ) )
                && MONTH ( 'Calendar'[Date] ) = MONTH ( SELECTEDVALUE ( Table1[Date] ) )
        ),
        "_Day", [fc_Delivery_Rate]
    ),
    [_Day]
)

Please always show your sample data in text-tabular format in addition to (or instead of)  screen captures. That allows people trying to help to readily copy the data and run a quick test, plus it increases the likelihood of your question being answered. Just use 'Copy table' in Power BI and paste it here. Or, ideally, share the pbix (beware of confidential data).

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.