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

Incorrect grand total and performance issue

First I use the following measure

 

3 M avg Switch = 
var cost = SUM ( DimCost[Actual Price] ) *[3 M avg RD QTY]
RETURN
IF (
    [Selected view] = 1,
    [3 M avg RD QTY],
    ROUND (cost, 0 )
)

 

In a table with DImDistritbutor[Distributor] and DimItem[Product] which gave me the wrong grand total. So then I used the following measure

 

 

3 M avg = SUMX(CROSSJOIN(VALUES(DimDistributor),VALUES(DimItem)),[3 M avg Switch])

 

 Now I get the correct grand total, but It heavily affected the performance. There are other measures also similar to this one and now it takes more than 15 seconds to load the table. Further when it published "visual has exceeded the available resources power bi" error occurs. 

 

3 M avg RD QTY = 
CALCULATE (
    AVERAGEX ( VALUES ( DimDate[Month] ), [Total RD QTY]),
    DATESINPERIOD (
        DimDate[Date],
        EOMONTH(TODAY(),-1),
        -3,
        MONTH
    )
)

 

Please give me a solution to get both correct grand total and performance. 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

what are calculation for [Selected view], [3 M avg RD QTY]

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak 
I already mentioned 3 M avg RD QTY, which is

3 M avg RD QTY = 
CALCULATE (
    AVERAGEX ( VALUES ( DimDate[Month] ), [Total RD QTY]),
    DATESINPERIOD (
        DimDate[Date],
        EOMONTH(TODAY(),-1),
        -3,
        MONTH
    )
)

 

Selected view = SELECTEDVALUE('Stock View'[Code],1)
view.PNG
table.PNG

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.

Top Solution Authors
Top Kudoed Authors