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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Sveina
Frequent Visitor

A row measure with lookup features

I am trying to solve a kind of lookup-value problem in PowerBI.

 

My goal is to calculate a measure that can extract spesific values based on their rownumber (dynamically). The values I want are in the column "Salary", and the number of rows to count down is calculated in the measure "Upper CI". 

 

The table will change when applying filters, but "SerialNO" is a dynamically calculated index. "SerialNO" might be relevant (as a lookup value for Salary - since it is equivalent to the rownumber in the dynamic table) or not. 

 

The best way to describe the problem might be to illustrate it with the desired solution. The table below contain the top 9 rows in my datatable. 

 

So, I am trying to calulate a measure corresponding to the column "Lookup result" (last column in the table). For example in the first row, the value for "Upper CI" is 3, hence I want the third row value from "Salary", that is "362000". In the second row the "Upper CI" is 5, hence I want the fifth row value from "Salary", that is 364 000.

 

And so on....

 

Hope someone is able to solve this one.

Thanks so much for any help!

 

Salary      SerialNO  UpperCI  Lookup result

350000

1

3362000

360000

25364000

362000

36366000
36400048 
364000510 
366000612 
371000713 
373000814 
375000916 

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@Sveina , That can do a new column like

 

MAxx(filter(Table, Table[SerialNo] = earlier(Table[Upper CI])), Table[Salary])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak  Thank you, really appreciate your help.

 

I probably should have mentioned that "SerialNO" and "UpperCI" are measures, not columns in a fixed table. Hence they will be recalculated (and change) when filters are applied. I have also construced a measure for "Salary" (using the function VALUES (Table([Salary])).  So all the variabels are actually measures.

 

I think your solution would have worked with tables, but unfurtunately not with measures. If you have any further suggestions your assistance would be much appreciated!

 

I am actually trying to construct a dynamic confidence interval around the empirical cumulative distribution function (ECDF) based on data from a salary survey. The methodology is that upper and lower bounds for the confidence interval is a function of the observations rank (when all observations are sorted ascending). The number calculated in the measure "Upper CI" is that ranking thershold value, and "SerialNO" implies whitch salary level (which row in the dynamic table) that corresponds to this threshold. 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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