Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

DAX If calculated column error

Hi Experts   I cannot see how to resolve the following DAX Error in a calculated column  VRoM/Budget Estimate =         IF(QUOTEMAN[TRUSTWITHCONSEQIMS] = 1 && QUOTEMAN[OPTNCHOICE] = 0, QUOTEMAN...
  • Samarth_18's avatar
    3 years ago

    Hi Anonymous ,

     

    You could try below code:-

    VRoM/Budget Estimate =
    VAR opt_cost =
        CALCULATE (
            MAX ( QUOTEMAN[OPTTOTALCOST] ),
            ALLEXCEPT ( QUOTEMAN, QUOTEMAN[IMSTASKID] )
        )
    RETURN
        SWITCH (
            TRUE (),
            QUOTEMAN[TRUSTWITHCONSEQIMS] = 1
                && QUOTEMAN[OPTNCHOICE] = 0, FORMAT ( QUOTEMAN[OPTTOTALCOST], "General Number" ),
            QUOTEMAN[TRUSTWITHCONSEQIMS] = 0
                && QUOTEMAN[OPTNCHOICE] = 1
                && QUOTEMAN[Column] <> BLANK (), "N/A",
            QUOTEMAN[TRUSTWITHCONSEQIMS] = 0
                && QUOTEMAN[OPTNCHOICE] = 1
                && QUOTEMAN[Column] = BLANK (), FORMAT ( [OPTTOTALCOST], "General Number" ),
            QUOTEMAN[TRUSTWITHCONSEQIMS] = 0
                && QUOTEMAN[OPTNCHOICE] = 0, FORMAT ( opt_cost, "General Number" )
        )