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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
DavidMG82
Helper I
Helper I

Value position withing two column ranges

Thanks ahead for you advice on this. 

 

I have a variable that determines the year:

var _year = 2020

 

and one variable that collects a value:

var _headcount = 550
 
How can I use a formula in return, to take the 550 and search on another sheet called 'pools' and find the correct value in column "Pool", like in this example the result should be based on the year and value: Pool 'D'
 
yearpoolheadcountMinheadcountMax
2020A5000 
2020B20015000
2020C10012000
2020D5011000
2020E251500
2020F101250
2020G1100
2021A5000 
2021B40015000
2021C25014000
2021D5012500
2021E301500
2021F201300
2021G1200
1 ACCEPTED SOLUTION
barritown
Super User
Super User

Hi @DavidMG82,

Please try this measure:

barritown_0-1687872618784.png

In plain text:

Measure = 
VAR _year = 2020
VAR _headcount = 550
RETURN "Pool '" & MINX ( FILTER ( data, [year] = _year && _headcount >= [headcountMin] && _headcount < [headcountMax] ), [pool] ) & "'"

 

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

View solution in original post

2 REPLIES 2
barritown
Super User
Super User

Hi @DavidMG82,

Please try this measure:

barritown_0-1687872618784.png

In plain text:

Measure = 
VAR _year = 2020
VAR _headcount = 550
RETURN "Pool '" & MINX ( FILTER ( data, [year] = _year && _headcount >= [headcountMin] && _headcount < [headcountMax] ), [pool] ) & "'"

 

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

Works as expected, thanks Alexander.

Helpful resources

Announcements
October NL Carousel

Fabric Community Update - October 2024

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