Forum Discussion

ericOnline's avatar
ericOnline
Post Patron
5 years ago
Solved

Using MEDIAN as LOOKUP column?

Hello,

I want to LookUp records based on the record closest to the Median value of a column. 

Example:

 

 

MAP_ZOOM_LAT = 

VAR varMid = MEDIAN(table[column1])
RETURN

    LOOKUPVALUE(
        table[latitude], 
        varMid,
        BLANK()
    )

 

 

 The error I receive is:

"Function LOOKUPVALUE expects a column reference as argument number 2"

 

How do I determine which record is closest to the Median value in a given column?

Thank you

2 Replies