Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
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êsShare feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 49 | |
| 40 | |
| 37 | |
| 14 | |
| 13 |
| User | Count |
|---|---|
| 85 | |
| 69 | |
| 37 | |
| 28 | |
| 27 |