Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi,
Can anyone help me here?
I have "Pending Days" field in D:hh:mm: ss format - ex- 1 day 00:30:00. I want to group them on 0-20 , 21 to 40, 41 to 60 days.......likewise
Logic: if "Pending Days" come in 0-20 days then "0-20 group" likewise
Ticket No | pending in days | Groups |
12345 | 0 Day 00:19:00 | 0-20 |
45678 | 23 Day 00:09:00 | 21 -40 |
54678 | 53 Day 00:19:00 | 41 -60 |
6789 | 41 Day 00:19:00 | 41-60 |
Solved! Go to Solution.
Hi @Shree_185 ,
You can create a calculated column wiht the following syntax:
Days Group =
SWITCH (
TRUE (),
LEFT ( 'Table'[pending in days], FIND ( "Day", 'Table'[pending in days] ) - 2 ) <= "20", "0-20",
LEFT ( 'Table'[pending in days], FIND ( "Day", 'Table'[pending in days] ) - 2 ) > "20"
&& LEFT ( 'Table'[pending in days], FIND ( "Day", 'Table'[pending in days] ) - 2 ) <= "40", "21-40",
LEFT ( 'Table'[pending in days], FIND ( "Day", 'Table'[pending in days] ) - 2 ) > "40"
&& LEFT ( 'Table'[pending in days], FIND ( "Day", 'Table'[pending in days] ) - 2 ) <= "60", "41-60",
">60"
)
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Shree_185
If you want to create a measure, you can try this,
Measure =
var _getDay= INT(LEFT(MIN('Table'[pending in days]),SEARCH("D",MIN('Table'[pending in days]),,BLANK())-2))
return SWITCH(TRUE(),
_getDay>=0 && _getDay<21,"0-20",
_getDay>=21 && _getDay<41,"21-40",
_getDay>=41 && _getDay<61,"41-60"
)
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Hi @Shree_185
If you want to create a measure, you can try this,
Measure =
var _getDay= INT(LEFT(MIN('Table'[pending in days]),SEARCH("D",MIN('Table'[pending in days]),,BLANK())-2))
return SWITCH(TRUE(),
_getDay>=0 && _getDay<21,"0-20",
_getDay>=21 && _getDay<41,"21-40",
_getDay>=41 && _getDay<61,"41-60"
)
Best Regards,
Community Support Team _Tang
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Thank you, you made my day!!!
Hi @Shree_185 ,
You can create a calculated column wiht the following syntax:
Days Group =
SWITCH (
TRUE (),
LEFT ( 'Table'[pending in days], FIND ( "Day", 'Table'[pending in days] ) - 2 ) <= "20", "0-20",
LEFT ( 'Table'[pending in days], FIND ( "Day", 'Table'[pending in days] ) - 2 ) > "20"
&& LEFT ( 'Table'[pending in days], FIND ( "Day", 'Table'[pending in days] ) - 2 ) <= "40", "21-40",
LEFT ( 'Table'[pending in days], FIND ( "Day", 'Table'[pending in days] ) - 2 ) > "40"
&& LEFT ( 'Table'[pending in days], FIND ( "Day", 'Table'[pending in days] ) - 2 ) <= "60", "41-60",
">60"
)
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsJoin the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.