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
Anonymous
Not applicable

3 Months Average of Sum

Hello all,

I want to create a simple report that has a line/column chart and a kpi on it. All I want to do is get the averag of the total of current month, next month, and the month after. I already have the sums for each month (you'll understand better when you see the pbix file), so I just gotta add those 3 numbers and divide them. Somehow, I managed that, but now I can't just get that average for the month that I received the file. Because I need that number, which is 2093, to divide the total quantity for the current month, which is 4285, so KPI should show 2.04 (See the the pbix file). 

Once you look at the pbix file you'll see what I'm trying to do. It should be easy but I'm not able come up with something. 

Thanks

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

To create measures as below.

Measure = 
VAR D =
    FORMAT (
        MAXX ( ALL ( 'Inventory' ), 'Inventory'[File_Arrival_Date] ),
        "MM-YYYY"
    )
RETURN
    CALCULATE (
        SUM ( Inventory[Quantity_Available_Eaches] ),
        FILTER (
            'Inventory',
            FORMAT ( 'Inventory'[File_Arrival_Date], "MM-YYYY" ) = D
                && 'Inventory'[File_Arrival_Date] = MAX ( 'Inventory'[File_Arrival_Date] )
        )
    )
Measure 2 =
VAR D =
    FORMAT (
        MAXX ( ALL ( 'Inventory' ), 'Inventory'[File_Arrival_Date] ),
        "MM-YYYY"
    )
RETURN
    CALCULATE (
        [MSR_Next_3_Months_Forecast_AVG],
        FILTER ( 'Date', FORMAT ( 'Date'[CALENDAR_DT], "MM-YYYY" ) = D )
    )
Indicator = 
DIVIDE ( [Measure], [Measure 2] )

Capture.PNG

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Thanks for the reply Frank, but when I highlight the columns from the visual, I get blank from the measures.

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.