Forum Discussion
Convert Text Data type to whole number
- Anonymous6 years agoHi Anonymous ,I have create below column for Hour MIN SEC requirement.PLease modify it little bit as you have days as well. Incase you are unable to do let me know i will do.REq_Time_Format = IF(SEARCH("sec",'Table'[Time],1,0)>0,SUBSTITUTE(IF(SEARCH("min",'Table'[Time],1,0)>0,SUBSTITUTE(IF(SEARCH("hour",'Table'[Time],1,0)>0,SUBSTITUTE('Table'[Time]," hour ",":"),"00:" & 'Table'[Time])," minute",":"),"00:00:" & 'Table'[Time]),"SEC",""),IF(SEARCH("min",'Table'[Time],1,0)>0,SUBSTITUTE(IF(SEARCH("hour",'Table'[Time],1,0)>0,SUBSTITUTE('Table'[Time]," hour ",":"),"00:" & 'Table'[Time])," minute",":"),"00:00:" & 'Table'[Time]) & "00")then go to modelling tab and convert this column to time format and type: HH:MM:SS:TTthen create one more column or you can add calculation in previous formula itself.In_Seconds = 'Table'[REq_Time_Format]*86400then perform your calculations &REq_Time_Format is already in your required format so you can display it as it is.Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar
If I resolve your problem Mark it as a solution and give kudos. - Anonymous6 years ago
AnonymousHi, I am getting the following error: DAX comparison operations do not support comparing values of type integer with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar
If I resolve your problem Mark it as a solution and give kudos.
Hi Anonymous
Create one [Days] Column =
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar
If I resolve your problem Mark it as a solution and give kudos.
- Anonymous6 years agoNot applicable
AnonymousHi, I am getting the following error: DAX comparison operations do not support comparing values of type integer with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values
- Anonymous6 years agoNot applicable
Hi Anonymous
Pleae check your DAX.
In IF part part when condition is true you are returning interger value(Find() function returns integer position.)
In else part you are returning "0" which is string. So instead of using "0" use 0.
Thanks & regards,
Pravin Wattamwar
www.linkedin.com/in/pravin-p-wattamwar
If I resolve your problem Mark it as a solution and give kudos.- Anonymous6 years agoNot applicable
And your DAx is not identical to my dax.
Please cross check it again.
Your IF part should compare your condition with 0 not with LEFT(......).
NOTE: FIND( ) and substitute are case Sensitive.