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

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]

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
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.