Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Measure using virtual table | Returning erro

Hi all, @ I'm receiving the error "Column '@xD' cannot be found or may not be used in this expression. Can you please help me pointing out, what I might be doing wrong in this expression? YoY Gr...
  • v-janeyg-msft's avatar
    4 years ago

    Hi, Anonymous 

     

    Yes, [@xD] is in your addcolumn table(pre_result) not in item_nnn table.

    So you can modify it like this:

    YoY Growth Items NNN JG (run rate monthly) =
    //The previous content remains unchanged
    VAR validation_run_rate_monthly_max =
        CALCULATE ( MAXX ( validation_run_rate_monthly, [@v_rr_monthly] ) )
    VAR result =
        SUMX (
            ADDCOLUMNS (
                items_nnn,
                "@xD",
                    IF (
                        validation_run_rate_monthly_max = 1,
                        IF (
                            AND ( [@items_nnn_jg_ly] = 0, [@items_nnn_jg] > 0 ) = TRUE,
                            "-",
                            DIVIDE (
                                [@items_nnn_jg] - [@items_nnn_jg_ly_run_rate_monthly],
                                [@items_nnn_jg_ly_run_rate_monthly]
                            )
                        ),
                        IF (
                            AND ( [@items_nnn_jg_ly] = 0, [@items_nnn_jg] > 0 ) = TRUE,
                            "-",
                            DIVIDE ( [@items_nnn_jg] - [@items_nnn_jg_ly], [@items_nnn_jg_ly] )
                        )
                    )
            ),
            [@xD]
        )
    RETURN
        result
    

    Did I answer your question? Please mark my reply as solution. Thank you very much.
    If not, please feel free to ask me.

     

    Best Regards,

    Community Support Team _Janey