Looking up a value in a column based on a measure in another table

In Power BI I have a measure that calculates the average value of a column. It always contains a number between 0 and 4

RoundedUpAverageScore = ROUND(AVERAGE(SmileyHistory[SatisfactionLevel]),0)

I then have a table that consists of a score from 0 to 4 and an url.

ScoreUrl

I want to use the RoundedUpAverageScore to look up which url to use for an image in Power Bi.

Naturally I cannot make a relation between a measure and a column in Power Bi, so the two tables are currently not connected.

Relations

Upvotes: 3

Views: 121

Answers (1)

Olly
Olly

Reputation: 7891

LOOKUPVALUE should do the trick:

Add the following MEASURE:

RoundedUpAverageURL = 
LOOKUPVALUE ( 
    Smileys_Sheet[Url],
    Smileys_Sheet[Score],
    [RoundedUpAverageScore]
)

Upvotes: 1

Related Questions