Forum Discussion
Conditional Column Question
- 3 years ago
Hi bdehning ,
According to your description, here's my solution.
Add a custom column in Power Query.
if [LOE By Year]=null then "No Data" else if[LOE By Year]<1 then "< 1 yr"else if [LOE By Year]<2 then "1 yr" else Text.Combine({Number.ToText(Number.RoundDown([LOE By Year]))," yrs"})Result:
Then in Desktop, select the LOE Range column, click Column tools>Sort by column>LOE By Year.
Get the expected result:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
But I want to see if they do exist in data 6 yrs, 7 yrs, 8, yrs, 9 yrs, etc?
- grantsamborn3 years ago
Solution Sage
If you want 50 buckets, you will probably need 50 lines of conditions unless you create a bucket table with the 50 buckets as well as upper and lower boundaries and a sort order column.
- bdehning3 years ago
Post Prodigy
Ok the Bucket Example is probably the best route and cleanest reather than 50 or more Else If's.