Search code examples
powerbissasdaxbusiness-intelligencemsbi

Unable to deploy metadata. reason : The syntax of 'Filter_Table' is incorrect


I created the following calculated column.

IsRenewal :=
VAR Filter_Table =
    SUMMARIZE (
        FILTER (
            SUMMARIZE (
                SUMMARIZE (
                    FACT_ACCOUNT;
                    FACT_ACCOUNT[ID_LOAN_INFORMATION];
                    FACT_ACCOUNT[ID_COSTUMER]
                );
                FACT_ACCOUNT[ID_COSTUMER];
                "abc"; COUNTROWS (
                    SUMMARIZE (
                        FACT_ACCOUNT;
                        FACT_ACCOUNT[ID_LOAN_INFORMATION];
                        FACT_ACCOUNT[ID_COSTUMER]
                    )
                )
            );
            [abc] > 1
        );
        FACT_ACCOUNT[ID_COSTUMER]
    )
VAR Latest =
    FILTER (
        Filter_Table;
        FACT_ACCOUNT[ID_COSTUMER] = EARLIER ( FACT_ACCOUNT[ID_COSTUMER] )
    )
RETURN
    IF ( ISBLANK ( Latest ); 0; 1 )

The following picture represent the result of the previous Dax expression. The result of the previous Dax expression

I got the result that I wanted in the new calculated column. But the problem is when i tried to deploy the model i got the following ERROR, "unable to deploy metadata. reason : The syntax for 'Filter_Table' is incorrect".

It seems that the problem is in the first variable that i create it. So I tried to run the result of Filter_Table in SSMS, but, I didn't get any syntax ERROR.

The following capture present the result of Filter_Table in SSMS The result of the first variable in SSMS

So i need help to find why i couldn't deploy my project.


Solution

  • It seems that i could not use a variable in the calculate column,so I resolved it by using the following expression

    IsRenewal :=
    IF (
        ISBLANK (
            FILTER (
                SUMMARIZE (
                    FILTER (
                        SUMMARIZE (
                            SUMMARIZE (
                                FACT_ACCOUNT;
                                FACT_ACCOUNT[ID_LOAN_INFORMATION];
                                FACT_ACCOUNT[ID_COSTUMER]
                            );
                            FACT_ACCOUNT[ID_COSTUMER];
                            "abc"; COUNTROWS (
                                SUMMARIZE (
                                    FACT_ACCOUNT;
                                    FACT_ACCOUNT[ID_LOAN_INFORMATION];
                                    FACT_ACCOUNT[ID_COSTUMER]
                                )
                            )
                        );
                        [abc] > 1
                    );
                    FACT_ACCOUNT[ID_COSTUMER]
                );
                FACT_ACCOUNT[ID_COSTUMER] = EARLIER ( FACT_ACCOUNT[ID_COSTUMER] )
            )
        );
        0;
        1
    )