Forum Discussion
Custom column gives a data type error when switching from mixed to full import mode
Hello everyone,
I was ready to have my associates review my Power BI report and the last thing I needed to do was switch to import mode. After switching my duration function is now throwing a data type error. It works completley fine when on mixed mode but when it is in full import mode It gives me an error. I understand the error is that I am trying to use a string in a fixed decimal data type equation, but I do not understand why import mode would cause this.
I have spent way to long trying to figure out how to get this column to work and am basically out of ideas for it to do exctly what I want besides this script. I have reached out to my organizations internal Power BI team and even they are stumped.
Any feedback would be appreciated.
SCRIPT
This is the working column in mixed modeThis is the error column in import mode
cmiller1221 , I doubt your datatype of the fixed decimal number.
For sum of duration refer to these
https://radacad.com/calculate-duration-in-days-hours-minutes-and-seconds-dynamically-in-power-bi-using-dax
https://social.technet.microsoft.com/wiki/contents/articles/33644.powerbi-aggregating-durationtime-in-dax.aspx
https://www.pbiusergroup.com/communities/community-home/digestviewer/viewthread?GroupId=547&MessageKey=814a2cb4-3cca-4cd1-a620-c467adeaaaf6&CommunityKey=b35c8468-2fd8-4e1a-8429-322c39fe7110&tab=digestviewer
https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389
4 Replies
- ToddChittSuper User
Can you verify that the data types as seen in Power Query or Import Mode are EXACTLY the same as they were when it was in Direct Query mode? Don't just assume by looking at the data in the Desktop, you need to note the data type(s) in Power Query.
Does the issue go away if you revert back to Direct Query?
- cmiller1221Regular Visitor
Thanks for the quick reply.
I just triple checked again and everything is exactly the same. The custom column is identical and so is everything in Power Query.
I do not believe you can revert back to direct query, but I have one file on direct and one file on import that are identical except for that. The direct query works and the import does not.
- amitchandakSuper User
cmiller1221 , I doubt your datatype of the fixed decimal number.
For sum of duration refer to these
https://radacad.com/calculate-duration-in-days-hours-minutes-and-seconds-dynamically-in-power-bi-using-dax
https://social.technet.microsoft.com/wiki/contents/articles/33644.powerbi-aggregating-durationtime-in-dax.aspx
https://www.pbiusergroup.com/communities/community-home/digestviewer/viewthread?GroupId=547&MessageKey=814a2cb4-3cca-4cd1-a620-c467adeaaaf6&CommunityKey=b35c8468-2fd8-4e1a-8429-322c39fe7110&tab=digestviewer
https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389- cmiller1221Regular Visitor
amitchandak None of the links fit except the last one which worked perfectly!! Thank you so much!