Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Refactor code using SUMX and SUMMARIZE

Is there a possible way to refactor the code I have written which is creating a summary table and getting the total sum where the check column is equals to 1:

 

 

Total GMRR (EUR) =
SUMX (
    FILTER (
        SUMMARIZE (
            fact_transaction_monthly,
            dim_partner[partner_created_date],
            dim_partner[partner_name],
            "GMRR", SUM ( fact_transaction_monthly[euroConsolidatedGMRR] ),
            "check", [checkActive]
        ),
        [check] = 1
    ),
    [GMRR]
)

 

It takes quite a long time to compute and I am pretty sure it's due to the iteration of the sum over the fact table

1 Reply

  • v-zhangti's avatar
    v-zhangti
    Community Support

    Hi, Anonymous 

     

    Can you provide sample data for testing? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures. I look forward to your response.

     

    Best Regards,

    Community Support Team _Charlotte

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