Forum Discussion

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,

     

    Please try this Calculated Column

     

    Column =
    SWITCH (
        TRUE (),
        Procurementdata[Transaction Amount] >= 25000001">$25M",
        Procurementdata[Transaction Amount] >= 100000000
            && Procurementdata[Transaction Amount] <= 25000000"$10M - $25M",
        Procurementdata[Transaction Amount] < 10000000"<$10M"
    )

     

    Regards,
    Harsh Nathani

    Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

  • v-yingjl's avatar
    v-yingjl
    Community Support

    Hi vjnvinod ,

    The ‘&&’ operator should not be used between two if() statements, just modify like this:

    Column = 
    IF(
        'Procurementdata'[Transaction Amount] >= 25000000,
        ">$25M",
        IF(
            'Procurementdata'[Transaction Amount] >= 10000000 &&
            'Procurementdata'[Transaction Amount] <  25000000 ,
            "$10M-$25M",
            "<$10M"
        )
    )

     

    Best Regards,
    Yingjie Li

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

    • vjnvinod's avatar
      vjnvinod
      Impactful Individual

      v-yingjl 

       

      thank you it actually worked but its not coming in order

      is it possible to  show  that in the below order?

      .$25M at top

      $10M-$25M

      <$10M

       

      • v-yingjl's avatar
        v-yingjl
        Community Support

        Hi vjnvinod ,

        Based on your picture, seems to order it in a slicer, right?

        Could not achieve it directly but you can create another column to mark each tag like a rank:

        Column 2 =
        IF (
            'Procurementdata'[Column] = ">$25M",
            1,
            IF ( 'Procurementdata'[Column] = "$10M-$25M", 2, 3 )
        )

        Click the three dots and choose sort by column2 and sort asc

         

        Best Regards,
        Yingjie Li

        If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

  • vjnvinod 

    if(condition1&&condition2), you need to remove the if I highlighted in the below screenshot.

     

     

    If you want to sort in order, you create a new table, column 1 order :1,2,3; column two values(like(>$25M). Create relationship with the fact table and order table.

    Or you can add the order number in the formula. "1. >$25M"