cancel
Showing results for
Did you mean:

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a \$100 discount. Register Now

## How to sum 1 every 5 new customers in a custom column

Hi everybody, I need to add a custom column where I count 1 every 5 new customers in the "Clientes Nuevos" column.

For example, with this data

the expected output would be

 Cada 5 clientes 1 1 7 1 3 2 3 1 2 1 1

what kind of function/logic can i use to calculate this on power query? Thanks in advance

1 ACCEPTED SOLUTION

Vijay, i already answered myself in this last comment, i just needed to use the Number.RoundDown function to get my expected result, anyway, thank you for your answer and time!

4 REPLIES 4
Super User

Looks like there is some other column driving your output. Can you also post required column and also what is the business logic for calculating this?

Hi Vijay, there's no other required column, i just need to figure out a way to Divide the "clientes nuevos" number by 5 and round the result down. For example, if i have 9 then 9/5 = 1.8 but my expected output need to be only 1, another example could be 34/5 = 6.8, but i need to round down that number to 6. Thank you for your answer

Vijay, i already answered myself in this last comment, i just needed to use the Number.RoundDown function to get my expected result, anyway, thank you for your answer and time!

Super User

Use below formula in a custom column

``= Number.IntegerDivide([Clientes nuevos],5)``

See the working here - Open a blank query - Home - Advanced Editor - Remove everything from there and paste the below code to test

``````let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMleK1YGRxpZgyhRMGppBKCMIZQGmoGLGSOqAZCwA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Clientes nuevos" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Clientes nuevos", Int64.Type}}),
in

Announcements

#### Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

#### Power BI Monthly Update - February 2024

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

#### Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

#### Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors