Forum Discussion
160475
4 years agoHelper I
multiple if
dears good day!! i would like to creat new column that has multiple if statment see pic below my statment would be if time commit<9:00 AM then on time if time commit between 9:00 am...
- 4 years ago
Hi,
Use the below code for creating the Column in your table :
StatusCol = If ( time(hour(Sheet115[TimeCommit]), minute(Sheet115[TimeCommit]), second(Sheet115[TimeCommit])) < time(09,00,00), "On Time",if( time(hour(Sheet115[TimeCommit]), minute(Sheet115[TimeCommit]), second(Sheet115[TimeCommit])) >= time(09,00,00)&&time(hour(Sheet115[TimeCommit]), minute(Sheet115[TimeCommit]), second(Sheet115[TimeCommit])) < time(09,15,00), "Almost Late",if( time(hour(Sheet115[TimeCommit]), minute(Sheet115[TimeCommit]), second(Sheet115[TimeCommit])) >= time(09,15,00)&&time(hour(Sheet115[TimeCommit]), minute(Sheet115[TimeCommit]), second(Sheet115[TimeCommit])) < time(09,30,00), "Late","After Working Houes")))then use it in your visuals.Appreciate your Kudos
nvprasad
4 years agoSolution Sage
Hi
You can try with below DAX
Remarks = Var TimeCommit = TABLE[TIME_COMMIT]
RETRUN SWITCH (TRUE(),
TimeCommit < TIME(9,0,0), "On Time"
TimeCommit >= TIME(9,0,0) && TimeCommit < TIME(9,15,0), "almost late",
TimeCommit >= TIME(9,15,0) && TimeCommit < TIME(9,30,0), "late",
blank())
Appreciate a Kudos!
If this helps and resolves the issue, please mark it as a Solution!
Regards,
N V Durga Prasad