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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
divergent
Frequent Visitor

Convert column to measure, so I can find min/max of it.

Hello, 

 

My target is to make a card showing the fastest airline (so extract top 1 row, with minimum time)

 

This is how my data looks, 

 

divergent_0-1701341240003.png

 

I am struggling to convert 'Flight_duration' column into a measure with same values, so I can then use a MINX function over it to create a min_duration measure, which I can later use to compare and use topN fucntion to just show the first value. 

 

I have a 'flight duration' column in my table. 

 

7 REPLIES 7
Dangar332
Super User
Super User

hI, @divergent 

try below

 

measure =
 max(tablename[flight_duration])

 



Thank you for your reply. 

What you suggested, apparently creates a measure with max values. What I am doing / trying to do is this: 

1. Convert somehow flight_duration column into a measure. 

tried this 

min = MIN('Indian Airlines'[Flight_duration])

2. Create a new measure to find the minimum value

min_fly_time = MINX(
                    ALLSELECTED('Indian Airlines'[airline]),[min]
)

3. Find / extract top (minimum value) 

Fastest_flight = //to check minimum time required by flight
    CALCULATE([min_fly_time],
        TOPN( 1, 
                FILTER(
                        VALUES('Indian Airlines'[airline]), [min_fly_time] = [min]
                ), [airline]
        )
    )

Can you spot where I am going wrong? I am unable to achieve the goal of extracting the top row.

 

hi, @divergent 

update your second measure to below

min fly = 
CALCULATE(MIN(flight[flight duration]),REMOVEFILTERS(flight[flight duration]))

Thank you that helps, but not entirely. 

Right now I am getting this 

 

divergent_0-1701355253444.png

However, I am seeking to get the output as airline name corresponding to this min_fly_time.  

My apologies for being a troublemaker 🙂

 

HI, @divergent 

check below image

Dangar332_0-1701357070735.png

 

Dangar332_1-1701357110607.png

 

Is there anyway, I could only get 'spice jet' as output that corresponds to the lowest value 1.6 in your final column, as that is exactly what I am trying to  achieve. 

We are getting close 🙂

HI, @divergent 

check below link 
click HERE 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.