Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Filter text with date and take information

Hi, I have a shipment with port information. We can see it started from CHINA - JAPAN - USA - CAN - BRITAIN based on ETD.

I would like to write dax to know the first port, second port, third, fourth and fifth port. And may use same logic for 1000+ order

Is the logic like,

Port 1 = calculate(??, ETD = lowest)

Port 2 = calculate(??, ETD = second lowest)...

 

Please help me with this, thanks!

 

  • Hi Anonymous 
    You can create a calculated column tht raks the orders then place it in a matrix visual. The only thing which I have doupt about is to make sure the date is actually a date type column not a text type column.

    Prot Order = 
    "Order "
        & RANKX ( 
            CALCULATETABLE ( 
                'Table', 
                ALLEXCEPT ( 'Table', 'Table'[Order Number] ) 
            ),
            'Table'[ETD]
        ) 
    Port = SELECTEDVALUE ( 'Table'[Dep] )

4 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you so much! It works!

  • tamerj1's avatar
    tamerj1
    Icon for Community Champion rankCommunity Champion

    Hi Anonymous 
    You can create a calculated column tht raks the orders then place it in a matrix visual. The only thing which I have doupt about is to make sure the date is actually a date type column not a text type column.

    Prot Order = 
    "Order "
        & RANKX ( 
            CALCULATETABLE ( 
                'Table', 
                ALLEXCEPT ( 'Table', 'Table'[Order Number] ) 
            ),
            'Table'[ETD]
        ) 
    Port = SELECTEDVALUE ( 'Table'[Dep] )
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks! It works!!!