Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
So I've got a what if parameter where the user enters a value, I then want to lookup this value in a table of 1000 values and then return another column from the row with the closest value
I.e the table is
1 | 100,000 |
2 | 350,000 |
3 | 20,000 |
4 | 478,000 |
The user would enter 290,000 and it return 2. Is this possible?
Solved! Go to Solution.
Hi @DarylRob ,
You can achieve this by using a difference between the what if and the table if you setup somehting similart to this:
Closest value =
VAR temptable =
TOPN (
1,
ADDCOLUMNS (
Table,
"@Difference", ABS ( Table[Value] - 'Parameter'[Parater Value] )
),
[@Difference], ASC
)
RETURN
MINX ( temptable, Table[ID] )
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @DarylRob ,
You can achieve this by using a difference between the what if and the table if you setup somehting similart to this:
Closest value =
VAR temptable =
TOPN (
1,
ADDCOLUMNS (
Table,
"@Difference", ABS ( Table[Value] - 'Parameter'[Parater Value] )
),
[@Difference], ASC
)
RETURN
MINX ( temptable, Table[ID] )
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThis is perfect, thank you
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
82 | |
42 | |
31 | |
27 | |
27 |