Forum Discussion

luis_pflucker's avatar
luis_pflucker
Icon for Helper II rankHelper II
4 years ago

not getting right values

Hi, 

I am trying to calculate a column based in a measure but not getting as I want:

Measure = sum(History[_ReTested (RFRT-Assigned) #])
Column 2 = if([Measure]=0,"0 reopened",if([Measure]=1,"1 reopened",if([Measure]=2,"2 reopened","more than 2")))
Should I get in Column 2 in the 2 first rows as a result: "2 reopened" ?? 
See attached/below the table with the result.

regards

Luis

5 Replies

  • Hello there luis_pflucker ! Why are you using a calculated column instead of another measure? Try this:

    Measure = 
    var _open = sum(History[_ReTested (RFRT-Assigned) #])
    
    return
    SWITCH( _open,
    0, "0 reopened",
    1, "1 reopened",
    2, "2 reopened",
    "more than 2")

    Hope this answer solves your problem! If you need any additional help please @ me in your reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️ or give it a kudoe 👍
    Thanks!

    You can also check out my LinkedIn!

    Best regards,
    Gonçalo Geraldes

    • luis_pflucker's avatar
      luis_pflucker
      Icon for Helper II rankHelper II

      Thanks Gonçalo, it helped, but with a measure i am not able to build a clustered chart, because is no way to put this measure in legend:

       

      • goncalogeraldes's avatar
        goncalogeraldes
        Icon for Super User rankSuper User

        Hello there luis_pflucker ! SInce that is the case, use a "Calculated Column" with the same formula and I think you can get your desired result.

         

        Hope this answer solves your problem! If you need any additional help please @ me in your reply.
        If my reply provided you with a solution, pleased mark it as a solution ✔️ or give it a kudoe 👍
        Thanks!

        You can also check out my LinkedIn!

        Best regards,
        Gonçalo Geraldes