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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Memory Issue with Avg Last 3 months Measure in Detailed Matrix Report

Hi PBI Expert, 

 

I've been trying on this calculation and it works when minumum amount of materials is filtered but will get into memory issue when i unfilter the material (can be up to 100++). However, user has request to view all materials in one go.

I have this matrix table per below.

celaeno_2-1622626507708.png

the measure that i'm using is below:-

Avglast3mthRev =

var CurrentMonthOrder = MAX(Data[Period Number])
var company = ALLSELECTED(Data[Company])
var material = SELECTEDVALUE(Data[Material])
return
CALCULATE(divide([Rev],3),
filter(all(Data),
Data[Period Number]<=CurrentMonthOrder&&Data[Period Number]>=CurrentMonthOrder-2
&&Data[Company] in Company
&&Data[material] = material))
 
Can someone please help to take a look on how i can improve this? We have a huge database of the data thus keep causing memory issue whenever user request measure in detailed table.. 
Really Appreciate the help!!! 🙂
 
Thank you,
Celaeno
2 REPLIES 2
v-janeyg-msft
Community Support
Community Support

Hi, @Anonymous 

 

Try like this:

Avglast3mthRev =
VAR CurrentMonthOrder =
    MAX ( Data[Period Number] )
RETURN
    CALCULATE (
        DIVIDE ( [Rev], 3 ),
        FILTER (
            ALLSELECTED ( Data ),
            Data[Period Number] <= CurrentMonthOrder
                && Data[Period Number] >= CurrentMonthOrder - 2
        )
    )

If it doesn't solve your problem, Please feel free to ask me.

 

Best Regards

Janey Guo

 

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

Anonymous
Not applicable

Try summarizing the table within Power Query using Group By. (I would suggest creating a reference query or a new one.  https://www.youtube.com/watch?v=kytYzjTXUHs Guy In a Cube channel has good guidance for this topic 🙂 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.