Forum Discussion

Ugot2Bsh1tingMe's avatar
Ugot2Bsh1tingMe
Regular Visitor
2 years ago
Solved

How to create a column based off the values in other columns

Hello,   I have a table that contains, among other things, order numbers, and order stop sequences. What I would like to achieve is to create a column that distinguishes based on stop sequence if t...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Ugot2Bsh1tingMe ,

    Thanks to mahenkj2  for the reply, please allow me to provide another insight:
    You can create a calculated column and then use the switch function to get the desired result.

    Column =
    VAR _max = CALCULATE(MAX('Table'[Order Stop Sequence]),FILTER(ALL('Table'),'Table'[Order Number] = EARLIER('Table'[Order Number])))
    RETURN
    SWITCH(TRUE(),
    'Table'[Order Stop Sequence] = 1,"Origin",
    'Table'[Order Stop Sequence] = _max,"Destination",
    "Stop Off")

    If your Current Period does not refer to this, please clarify in a follow-up reply.

     

    Best Regards,

    Clara Gong

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