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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors