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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DavidMG82
Frequent Visitor

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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