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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.