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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
roncruiser
Post Patron
Post Patron

Rounding Closest Value in a Column Based on Values in a Column from another table.

Hello,

I've been bouncing around this issue for a couple days now with no luck using Power Query.


I'd like to return rounded to nearest values based on values from another column.
My first idea was using the merge function, but that will only work if the values match.
Is there a way to integrate the Number.Round function into the merge function, or is that the wrong approach?

 

Table 1 (The 3rd column is what I would like returned)

Location ValueRounded to Nearest
(Return this Column)
A20
B35
C2930
D1520
E2020
F2725
G1110
H75
I910


This is the reference table used to round to the nearest value.
Table 2 (Values to round to)

0
5
10
20
25
30


Thank You.

2 REPLIES 2
jaipal
Resolver III
Resolver III

@roncruiser   merge the tables and try this

Number.Round( _ , [Reference Column]) 

Makesure the value columns are Integer type

@jaipal 

I'm unsure where to place the Number.Round(_,[Reference Column] when doing a NextJoin with JoinKind.FullOuter.

It works if the numbers match but won't round to the nearest number if the number falls between numbers in the reference table.
Please clarify.

Thank You.


Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors