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
yve214
Helper III
Helper III

Get even total average across months

Hi there,

 

I need help with getting an even average across the calendar months counting from the start date adding to 12 months. I have a date table connected to my data table through the "start_date".

 

I just need the average from the total evenly spread across the months starting from the start date for instance, please see result below.

 

Thank you in advance for your help.

 

Data:

producttotal_amtstart_dateend_dateMonths
a1004/1/20203/31/202112
b2001/1/202012/31/202012
c3002/1/20201/31/202112

 

Expected Result:

producttotal_amtstart_dateend_dateMonthsJan-2020feb-2020march-2020April-2020May-2020jun-2020Jul-2020Aug-2020Sept-2020Oct-2020Nov-2020Dec-2020jan-2021feb-2021March-2021
a1004/1/20203/31/202112   8.38.38.38.38.38.38.38.38.38.38.38.3
b2001/1/202012/31/20201216.716.716.716.716.716.716.716.716.716.716.716.7   
c3002/1/20201/31/202112 252525252525252525252525  
1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

Picture2.png

 

Expected result measure: =
VAR monthscount =
    COUNTROWS (
        SUMMARIZE (
            FILTER (
                ALL ( 'Calendar' ),
                'Calendar'[Date] >= MAX ( Data[start_date] )
                    && 'Calendar'[Date] <= MAX ( Data[end_date] )
            ),
            'Calendar'[Month & Year]
        )
    )
VAR totalamount =
    SUM ( Data[total_amt] )
VAR result =
    DIVIDE ( totalamount, monthscount )
RETURN
    IF (
        MIN ( 'Calendar'[Date] ) >= MAX ( Data[start_date] )
            && MAX ( 'Calendar'[Date] ) <= MAX ( Data[end_date] ),
        result
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

Picture2.png

 

Expected result measure: =
VAR monthscount =
    COUNTROWS (
        SUMMARIZE (
            FILTER (
                ALL ( 'Calendar' ),
                'Calendar'[Date] >= MAX ( Data[start_date] )
                    && 'Calendar'[Date] <= MAX ( Data[end_date] )
            ),
            'Calendar'[Month & Year]
        )
    )
VAR totalamount =
    SUM ( Data[total_amt] )
VAR result =
    DIVIDE ( totalamount, monthscount )
RETURN
    IF (
        MIN ( 'Calendar'[Date] ) >= MAX ( Data[start_date] )
            && MAX ( 'Calendar'[Date] ) <= MAX ( Data[end_date] ),
        result
    )

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

@Jihwan_Kim Thank you so much. I was able to get my variables similarly to the one you had but I made the mistake of conencting my tables to the data table. This worked perfectly, thank you.

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.