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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply

LOOKVALUE NEAREST : Nearest value based on other columns values

Hi,  

 

i nees your help.  I have 2 tables,

 

the fist is the tableA: kardex of amount of a credit line (profiles of credit card limits):

 

CESARPULIDOGDL_0-1681184152665.png

 

the second its tableB: de average purschase by customer.

 

CESARPULIDOGDL_1-1681184290750.png

 

i need the nearest value beetween purchases cust. & profiles, in order to have a credit limit by cust (nearest up).

 

thank u. 

 

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could create a column in TableB like

Credit Limit =
VAR AvgPurchase = 'TableB'[Average purchase]
VAR Result =
    CALCULATE (
        MIN ( 'TableA'[Credit line amount] ),
        'TableA'[Credit line amount] >= AvgPurchase
    )
RETURN
    Result

View solution in original post

2 REPLIES 2

@johnt75  Thank you so much. It's work's!!  😁

johnt75
Super User
Super User

You could create a column in TableB like

Credit Limit =
VAR AvgPurchase = 'TableB'[Average purchase]
VAR Result =
    CALCULATE (
        MIN ( 'TableA'[Credit line amount] ),
        'TableA'[Credit line amount] >= AvgPurchase
    )
RETURN
    Result

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!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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