Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi,
I have a custom column created & it is the below:
=if(YEAR(Task[UpdatedDate])<>1970,SWITCH (
TRUE (),
Task[UpdateAge_Days] <1 , "<1 Day",
AND(Task[UpdateAge_Days] <=2 ,Task[UpdateAge_Days] >=1),"1-2 Days",
AND(Task[UpdateAge_Days] <=3 ,Task[UpdateAge_Days] >2),"3 Days",
AND(Task[UpdateAge_Days] <=5 ,Task[UpdateAge_Days] >3),"4-5 Days",
AND(Task[UpdateAge_Days] <=10 ,Task[UpdateAge_Days] >5),"5-10 Days",
Task[UpdateAge_Days] >10 ,">10 Days "
))
I want to sort as per above,but it shows the below:
<1day
>10days
1-2days
3days
4-5days
5-10days
I want it to be like this:
<1day
1-2days
3days
4-5days
5-10days
>10days
Please help in sorting the above
Solved! Go to Solution.
Read about "Sort a column by another column".
Your code can be cleaned up:
=SWITCH (
TRUE (),
YEAR(Task[UpdatedDate])=1970,BLANK()
Task[UpdateAge_Days] <1 ,"<1 Day",
Task[UpdateAge_Days] <=2,"1-2 Days",
Task[UpdateAge_Days] <=3,"3 Days",
Task[UpdateAge_Days] <=5,"4-5 Days",
Task[UpdateAge_Days] <=10,"5-10 Days",
">10 Days "
)
hi @Anonymous
You need to creat two columns
Label =
SWITCH (
TRUE (),
YEAR(Task[UpdatedDate])=1970,BLANK(),
Task[UpdateAge_Days] <1 ,"<1 Day",
Task[UpdateAge_Days] <=2,"1-2 Days",
Task[UpdateAge_Days] <=3,"3 Days",
Task[UpdateAge_Days] <=5,"4-5 Days",
Task[UpdateAge_Days] <=10,"5-10 Days",
">10 Days "
)
Label (sort) =
SWITCH (
TRUE (),
YEAR(Task[UpdatedDate])=1970, 99,
Task[UpdateAge_Days] <1 , 1,
Task[UpdateAge_Days] <=2, 2,
Task[UpdateAge_Days] <=3, 3,
Task[UpdateAge_Days] <=5, 4,
Task[UpdateAge_Days] <=10, 5,
6
)
like this you can use column "Label (sort)" to sort the first one.
Any other question please ask.
Best regards
Bruno Costa | Impactful Individual
Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
You can also check out BI4ALL's website and our data solutions!
Best regards
Bruno Costa | Super User
Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!!
Take a look at the blog: PBI Portugal
hi @Anonymous
Does my suggestion work?
If yes then please accept my answer have solution thanks
Best regards
Bruno Costa | Impactful Individual
Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
You can also check out BI4ALL's website and our data solutions!
Best regards
Bruno Costa | Super User
Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!!
Take a look at the blog: PBI Portugal
Thank you all for your help!
hi @Anonymous
You need to creat two columns
Label =
SWITCH (
TRUE (),
YEAR(Task[UpdatedDate])=1970,BLANK(),
Task[UpdateAge_Days] <1 ,"<1 Day",
Task[UpdateAge_Days] <=2,"1-2 Days",
Task[UpdateAge_Days] <=3,"3 Days",
Task[UpdateAge_Days] <=5,"4-5 Days",
Task[UpdateAge_Days] <=10,"5-10 Days",
">10 Days "
)
Label (sort) =
SWITCH (
TRUE (),
YEAR(Task[UpdatedDate])=1970, 99,
Task[UpdateAge_Days] <1 , 1,
Task[UpdateAge_Days] <=2, 2,
Task[UpdateAge_Days] <=3, 3,
Task[UpdateAge_Days] <=5, 4,
Task[UpdateAge_Days] <=10, 5,
6
)
like this you can use column "Label (sort)" to sort the first one.
Any other question please ask.
Best regards
Bruno Costa | Impactful Individual
Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
You can also check out BI4ALL's website and our data solutions!
Best regards
Bruno Costa | Super User
Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!!
Take a look at the blog: PBI Portugal
hi @Anonymous
Does my suggestion work?
If yes then please accept my answer have solution thanks
Best regards
Bruno Costa | Impactful Individual
Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍
You can also check out BI4ALL's website and our data solutions!
Best regards
Bruno Costa | Super User
Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!!
Take a look at the blog: PBI Portugal
Read about "Sort a column by another column".
Your code can be cleaned up:
=SWITCH (
TRUE (),
YEAR(Task[UpdatedDate])=1970,BLANK()
Task[UpdateAge_Days] <1 ,"<1 Day",
Task[UpdateAge_Days] <=2,"1-2 Days",
Task[UpdateAge_Days] <=3,"3 Days",
Task[UpdateAge_Days] <=5,"4-5 Days",
Task[UpdateAge_Days] <=10,"5-10 Days",
">10 Days "
)
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 55 | |
| 40 | |
| 35 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 71 | |
| 70 | |
| 38 | |
| 35 | |
| 23 |