Forum Discussion
New costum column
Hello ChristianAU,
If my post helped you, please give me a 👍kudos and mark this post with Accept as Solution.
let
Source = #"Course data",
AddedCustom = Table.AddColumn(Source, "EngagementHours Grouped", each
if [Attribute] = "EngagementHours" then
if [Value] >= 0 and [Value] <= 5 then "1: 0-5"
else if [Value] >= 6 and [Value] <= 10 then "2: 6-10"
else if [Value] >= 11 and [Value] <= 15 then "3: 11-15"
else if [Value] >= 16 and [Value] <= 20 then "4: 16-20"
else if [Value] >= 21 and [Value] <= 25 then "5: 21-25"
else if [Value] >= 26 and [Value] <= 30 then "6: 26-30"
else if [Value] >= 31 and [Value] <= 37 then "7: >30"
else null
else null
)
in
AddedCustom
Best regards from Germany
Manuel Bolz
🟦Follow me on LinkedIn
🟨How to Get Your Question Answered Quickly
🟩Fabric Community Conference
🟪My Solutions on Github
Thank you for your response. However, i made it work with this solution:
= let
Source = #"Changed Type4",
AddedCustom = Table.AddColumn(Source, "EngagementHours Grouped", each
if [Attribute] = "EngagementHours" then
if [Value] >= 0 and [Value] <= 5 then "1: 0-5"
else if [Value] >= 6 and [Value] <= 10 then "2: 6-10"
else if [Value] >= 11 and [Value] <= 15 then "3: 11-15"
else if [Value] >= 16 and [Value] <= 20 then "4: 16-20"
else if [Value] >= 21 and [Value] <= 25 then "5: 21-25"
else if [Value] >= 26 and [Value] <= 30 then "6: 26-30"
else if [Value] >= 31 then "7: >30"
else null
else null)
in
AddedCustom
I tested your solution, and it gave me all errors. I guess you have to make the previous step in power query the source, and not the table itself. Which is weird.