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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Mburman-07
Helper I
Helper I

Looking up a measure value in another table

Hi All,

I've been tasked with recreating an excel sheet in Power BI.
One of the formulas used in the excel is a nested vlookup, =VLOOKUP(VLOOKUP((('P50'!H13/('Month Hours'!$B$8))/8),RWS!$A:$B,1,TRUE),RWS!$A:$B,2,FALSE)

In Power BI the P50 is a measure, Month Hours is a column in my Calendar table and RWS A:B is now the columns Power KW and Windspeed KMS in a seperate table. 

I want to take the value returned from the first part of the VLOOKUP so (P50/month hours)/8 and look that up aaginst the PowerKW column and then return the windspeed KMS column. I'm not sure it's possible to do in Power BI.

Thanks in advance,

Mike

1 ACCEPTED SOLUTION
vs_7
Continued Contributor
Continued Contributor

hi @Mburman-07 ,

 

try below measure
IntermediateValue = DIVIDE([P50 Measure], MAX('Calendar'[Month Hours])) / 8

ClosestPowerKW =
VAR TargetValue = [IntermediateValue]
RETURN
MINX(
TOPN(
1,
FILTER(
'RWS',
ABS('RWS'[Power KW] - TargetValue) =
MINX(
FILTER('RWS', ABS('RWS'[Power KW] - TargetValue) >= 0),
ABS('RWS'[Power KW] - TargetValue)
)
),
ABS('RWS'[Power KW] - TargetValue),
ASC
),
'RWS'[Power KW]
)

ResultWindspeedKMS =
VAR ClosestKW = [ClosestPowerKW]
RETURN
MAXX(
FILTER('RWS', 'RWS'[Power KW] = ClosestKW),
'RWS'[Windspeed KMS]
)






View solution in original post

3 REPLIES 3
Kedar_Pande
Super User
Super User

@Mburman-07 

Create a measures

Intermediate Value = 
DIVIDE(
DIVIDE([P50], MAX('Calendar'[Month Hours])),
8
)
Closest Power KW = 
MAXX(
TOPN(
1,
FILTER(
'RWS',
'RWS'[Power KW] <= [Intermediate Value]
),
'RWS'[Power KW],
DESC
),
'RWS'[Power KW]
)
Resulting Windspeed KMS = 
MAXX(
FILTER(
'RWS',
'RWS'[Power KW] = [Closest Power KW]
),
'RWS'[Windspeed KMS]
)

💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

 

Bibiano_Geraldo
Super User
Super User

Hi @Mburman-07 ,

First, Create a measure to calculate (P50 / Month Hours) / 8

First Lookup Value = 
DIVIDE(
    DIVIDE([P50], MAX('Calendar'[Month Hours])),
    8
)

 

Create a measure to find the closest value in the PowerKW column:

Closest PowerKW = 
VAR TargetValue = [First Lookup Value]
RETURN
    CALCULATE(
        MAX('RWS'[PowerKW]),
        FILTER(
            'RWS',
            'RWS'[PowerKW] <= TargetValue
        )
    )

 

Create another measure to return the corresponding Windspeed KMS

Result Windspeed = 
VAR ClosestPower = [Closest PowerKW]
RETURN
    CALCULATE(
        MAX('RWS'[Windspeed KMS]),
        'RWS'[PowerKW] = ClosestPower
    )

 

Now, you can use the Result Windspeed measure in your visuals to display the calculated windspeed for each context.

 

 

vs_7
Continued Contributor
Continued Contributor

hi @Mburman-07 ,

 

try below measure
IntermediateValue = DIVIDE([P50 Measure], MAX('Calendar'[Month Hours])) / 8

ClosestPowerKW =
VAR TargetValue = [IntermediateValue]
RETURN
MINX(
TOPN(
1,
FILTER(
'RWS',
ABS('RWS'[Power KW] - TargetValue) =
MINX(
FILTER('RWS', ABS('RWS'[Power KW] - TargetValue) >= 0),
ABS('RWS'[Power KW] - TargetValue)
)
),
ABS('RWS'[Power KW] - TargetValue),
ASC
),
'RWS'[Power KW]
)

ResultWindspeedKMS =
VAR ClosestKW = [ClosestPowerKW]
RETURN
MAXX(
FILTER('RWS', 'RWS'[Power KW] = ClosestKW),
'RWS'[Windspeed KMS]
)






Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors