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
nofan_munawar
Frequent Visitor

how to improve cumulative performance

hi everyone,

 

i have performance issue with cumulative, my idea is to move the logic from powerBI to sql, is it effective ? or any other suggestion ?

below my dax script which have performance issue

nofan_munawar_0-1667981488603.png

cumCustomerByBook =
var maxDate = calculate(MAX(SellingUnit[logDate]),SellingUnit[clusterCode_unit]in VALUES(ClusterMapping[clusterCode_unit]))
return
CALCULATE(SUM(SellingUnit[counting_unit]),
FILTER(
    ALL(SellingUnit),SellingUnit[logDate]<= maxDate &&
                    SellingUnit[flag] = "Customer"  &&
                    SellingUnit[isLaunching] = 1 &&
                    SellingUnit[clusterCode_unit]
                        in VALUES(ClusterMapping[clusterCode_unit])
                    ))
 

thanks

1 ACCEPTED SOLUTION

finally i found the solution

 

nofan_munawar_0-1668766983086.png

oke, the issue is "slow performance while using cumulative"

root couse -> my chart using "dimdate" instead of "logdate"

solution -> for cumulative dont using relational table, use column that u call in measure

i change from dimDate to logdate and viola from 1 minutes to 15seconds

 

 

View solution in original post

4 REPLIES 4
nofan_munawar
Frequent Visitor

@v-shex-msft 

 

i have an update sir,

one factor why the performance is not good is because im include year on date hierarchy

nofan_munawar_0-1668054077627.png

without year it takes 4 second, and with year it takes 1 minutes

 

 

 

nofan_munawar
Frequent Visitor

hi @v-shex-msft , thanks for your fast response


9765 -> total row data

nofan_munawar_0-1668049319319.png

 

i want to compare cumulative value group by flag (customer & sales)
thats why i create 2 measure ( cumulative by customer, cumulative by sales )
which my previous excample is cumulative by customer -> 

 

SellingUnit[flag] = "Customer"

 

and also i want to filter by date and cluster ( it can be multiple filter ) -> thats by im using "in values"

 

SellingUnit[clusterCode_unit]
in VALUES(ClusterMapping[clusterCode_unit])

 

and function by default of cumulative im using maxdate

 

SellingUnit[logDate]<= maxDate

 

while im using your script the result is different

nofan_munawar_1-1668049359762.png

 

warm regards,

Nofan irkham

 

v-shex-msft
Community Support
Community Support

Hi @nofan_munawar,

How many records stored in data table that you calculated? Can you please share some mode detail about your scenario?

How to Get Your Question Answered Quickly  

It obviously will cause the performance issue when you use cumulative expression to calculate through huge amount of table records. You can also try to use the following formula if helps:

cumCustomerByBook =
VAR maxDate =
    CALCULATE (
        MAX ( SellingUnit[logDate] ),
        ALLSELECTED ( SellingUnit ),
        VALUES ( ClusterMapping[clusterCode_unit] )
    )
RETURN
    CALCULATE (
        SUM ( SellingUnit[counting_unit] ),
        FILTER (
            ALLSELECTED ( SellingUnit ),
            SellingUnit[logDate] <= maxDate
                && SellingUnit[flag] = "Customer"
                && SellingUnit[isLaunching] = 1
        ),
        VALUES ( ClusterMapping[clusterCode_unit] )
    )

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

finally i found the solution

 

nofan_munawar_0-1668766983086.png

oke, the issue is "slow performance while using cumulative"

root couse -> my chart using "dimdate" instead of "logdate"

solution -> for cumulative dont using relational table, use column that u call in measure

i change from dimDate to logdate and viola from 1 minutes to 15seconds

 

 

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.