Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Solved! Go to 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!
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!
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}}),
#"Added Custom" = Table.AddColumn(#"Changed Type", "Cada 5 clientes", each Number.IntegerDivide([Clientes nuevos],5), type number)
in
#"Added Custom"
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
102 | |
53 | |
21 | |
12 | |
12 |