Forum Discussion
How to create time slots in Power BI data set ?
- Anonymous9 years ago
Hi sanjeev803,
Right click your table in Power BI Desktop, select “New column”, paste the following formula. Then create a table visual, for more details, see the example in the screenshots below.
CYCLE TIMES = IF(Table[Networkdays]<=3, "0-3 days",IF(Table[Networkdays]<=7,"4-7 days",IF(Table[Networkdays]<=14,"8-14 days",IF(Table[Networkdays]<=30, "15-30 days","31+ days"))))
Thanks,
Lydia Zhang - 9 years ago
... and if you want to avoid all those nested IF statements you can use the SWITCH statement:
SWITCH(TRUE(),
NetworkDays <= 3, "0-3 days",
NetworkDays <=10, "3-10 days",
"10+ days")
Cheers,
Christian
- 9 years ago
Thank you. Its working perfectly fine. :)
Hi sanjeev803,
Right click your table in Power BI Desktop, select “New column”, paste the following formula. Then create a table visual, for more details, see the example in the screenshots below.
CYCLE TIMES = IF(Table[Networkdays]<=3, "0-3 days",IF(Table[Networkdays]<=7,"4-7 days",IF(Table[Networkdays]<=14,"8-14 days",IF(Table[Networkdays]<=30, "15-30 days","31+ days"))))
Thanks,
Lydia Zhang
... and if you want to avoid all those nested IF statements you can use the SWITCH statement:
SWITCH(TRUE(),
NetworkDays <= 3, "0-3 days",
NetworkDays <=10, "3-10 days",
"10+ days")
Cheers,
Christian