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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
SGV
Frequent Visitor

Getting not enough memory error on powerbi

When i run the below dax formula i'm getting the not enough memory error. How do I fix it please

Impact =
VAR Success = SELECTCOLUMNS(Filter(Payment,Payment[TransactionStatus]="true"),"Cust_id_Month",CONCATENATE([Cust_Id],Payment[Month]))
Return IF(CONCATENATE(Payment[Cust_Id],Payment[Month]) in Success,"No","Yes")

 

I'm trying to see if the payment failure had impact on churn. I.e. did the customer have a successful payment that month.

I'm filtering on successful transaction, storing it as a table "Success" and then checking if the cust_Id, Month combination for each payment is found in Success. If found then it's found then "No" the payment failure had no impact on churn for that month, if not found then "yes" the payment failure had impact on churn.

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

Hi @SGV ,

 

Here's an optimized version of your DAX formula:

 

Column:

Impact =
VAR Success =
    CALCULATETABLE (
        VALUES ( Payment[Cust_Id] ),
        Payment[TransactionStatus] = "true",
        ALLEXCEPT ( Payment, Payment[Month] )
    )
RETURN
    IF (
        CONTAINS ( Success, Payment[Cust_Id], Payment[Cust_Id] ),
        "No",
        "Yes"
    )

Measure:

Impact Measure :=
VAR Success =
    CALCULATETABLE (
        VALUES ( Payment[Cust_Id] ),
        Payment[TransactionStatus] = "true",
        ALLEXCEPT ( Payment, Payment[Month] )
    )
VAR CurrentCustIdMonth =
    CONCATENATE ( SELECTEDVALUE ( Payment[Cust_Id] ), SELECTEDVALUE ( Payment[Month] ) )
RETURN
    IF (
        CONTAINS ( Success, Payment[Cust_Id], SELECTEDVALUE ( Payment[Cust_Id] ) ),
        "No",
        "Yes"
    )

This formula uses and to create a table of unique values with successful transactions for each month. Then, it uses the function to check if the is in the table. If it is, the formula returns "No", otherwise, it returns "Yes".


If you still encounter memory issues, consider reducing the amount of data being processed or optimizing your data model. You can also use tools like DAX Studio to analyze and optimize your DAX queries.

 

Best Regards,

Neeko Tang

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

 

 

View solution in original post

4 REPLIES 4
v-tangjie-msft
Community Support
Community Support

Hi @SGV ,

 

Here's an optimized version of your DAX formula:

 

Column:

Impact =
VAR Success =
    CALCULATETABLE (
        VALUES ( Payment[Cust_Id] ),
        Payment[TransactionStatus] = "true",
        ALLEXCEPT ( Payment, Payment[Month] )
    )
RETURN
    IF (
        CONTAINS ( Success, Payment[Cust_Id], Payment[Cust_Id] ),
        "No",
        "Yes"
    )

Measure:

Impact Measure :=
VAR Success =
    CALCULATETABLE (
        VALUES ( Payment[Cust_Id] ),
        Payment[TransactionStatus] = "true",
        ALLEXCEPT ( Payment, Payment[Month] )
    )
VAR CurrentCustIdMonth =
    CONCATENATE ( SELECTEDVALUE ( Payment[Cust_Id] ), SELECTEDVALUE ( Payment[Month] ) )
RETURN
    IF (
        CONTAINS ( Success, Payment[Cust_Id], SELECTEDVALUE ( Payment[Cust_Id] ) ),
        "No",
        "Yes"
    )

This formula uses and to create a table of unique values with successful transactions for each month. Then, it uses the function to check if the is in the table. If it is, the formula returns "No", otherwise, it returns "Yes".


If you still encounter memory issues, consider reducing the amount of data being processed or optimizing your data model. You can also use tools like DAX Studio to analyze and optimize your DAX queries.

 

Best Regards,

Neeko Tang

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

 

 

Thank you so much!

johnt75
Super User
Super User

You could try

Impact =
VAR Successes =
    FILTER (
        ALLEXCEPT (
            Payment,
            Payment[[Cust_Id],
            Payment[Month],
            Payment[TransactionStatus]
        ),
        Payment[TransactionStatus] = "true"
    )
RETURN
    IF ( ISEMPTY ( Successes ), "Yes", "No" )
SGV
Frequent Visitor

After testing it,i've realized that the formula is putting only failed payments where impact is yes. Remember I wanted customers who had a failed payment and a successful payment in the same month.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.