Power Query where to put Number Round

dicken

Active Member
Joined
Feb 12, 2022
Messages
292
Office Version
  1. 365
Platform
  1. Windows
Hi
I've been trying to use Number.Round and can't seem to put it in the right place,

the column being rounded is as follows;


Excel Formula:
 Table.AddColumn(#"Added Custom3", "Custom", each Text.Combine( 
List.Transform( 
List.Distinct( [Count] [stdev] ),(_)=> Text.From(_) ),", "))

I know I can just change the data type to decimal number but it's annoing me.
Richard

1660844100565.png
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Since you are creating the column based on calling for Text, you'll first want to change it to a Number (I know...we're still in M Code here). And then you should be able to include your Number Round.

So Give this a shot:
Number.Round(
Number.FromText(
Text.Combine(
List.Transform(
List.Distinct( [Count] [stdev] ),(_)=> Text.From(_) ),", "))),[Number of Decimal Places])
 
Upvote 0
Solution
Since you are creating the column based on calling for Text, you'll first want to change it to a Number (I know...we're still in M Code here). And then you should be able to include your Number Round.

So Give this a shot:
Number.Round(
Number.FromText(
Text.Combine(
List.Transform(
List.Distinct( [Count] [stdev] ),(_)=> Text.From(_) ),", "))),[Number of Decimal Places])
Hi,
Sorry for not getting back to you sooner, worked but not how I expected, as soon as I used Number form text or eve just Number.From,
it became rounded to 2 places and jumped to the 'right ' side, so using Number.Round wasn'te needed unless you want less then two decimal places, I love (?) the fact that I had to convert to text to use Text.combine and then back to a number to round ho hum.

Will mark up as solved.

Richard.
 
Upvote 0

Forum statistics

Threads
1,223,634
Messages
6,173,475
Members
452,516
Latest member
archcalx

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top