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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
CESARPULIDOGDL
Frequent Visitor

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
CESARPULIDOGDL
Frequent Visitor

@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
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.