Forum Discussion

delia's avatar
delia
Frequent Visitor
8 years ago
Solved

switch function

Hi, I have a switch function as follows: EstDesc = Switch ( TRUE (),  WorkRequest[CurrentEstimate] = 97,"Small",  WorkRequest[CurrentEstimate] = 497,"Medium",  WorkRequest[CurrentEstimate] = 997,...
  • v-jiascu-msft's avatar
    v-jiascu-msft
    8 years ago

    Hi delia,

     

    That's a limitation of Direct Query. Please try it like below.

    EstDesc =
    SWITCH (
        TRUE (),
        WorkRequest[CurrentEstimate] = 97, "Small",
        WorkRequest[CurrentEstimate] = 497, "Medium",
        WorkRequest[CurrentEstimate] = 997, "Large",
        WorkRequest[CurrentEstimate] = 1997, "X-Large",
        "" & WorkRequest[CurrentEstimate]
    )

    switch_function

     

    Best Regards,

    Dale