cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills 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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors