Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Anonymous
Not applicable

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.

weezzy_1-1664502510432.png

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

weezzy_2-1664502586024.png

Is the logic like,

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

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

 

Please help me with this, thanks!

 

2 ACCEPTED SOLUTIONS
VahidDM
Super User
Super User

Hi @Anonymous 

 

Please download the attached file.

 

Output:

VahidDM_0-1664504470437.png

 

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

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

 

 

View solution in original post

tamerj1
Super User
Super User

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.

2.png1.png

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

View solution in original post

4 REPLIES 4
tamerj1
Super User
Super User

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.

2.png1.png

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

Thanks! It works!!!

VahidDM
Super User
Super User

Hi @Anonymous 

 

Please download the attached file.

 

Output:

VahidDM_0-1664504470437.png

 

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

Appreciate your Kudos!! 

Badges.jpg

LinkedIn | Twitter | Blog | YouTube 

 

 

Anonymous
Not applicable

Thank you so much! It works!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

Find out what's new and trending in the Fabric community.