Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Dataflow Null Date Value

I'm receiving the following error and am not able to relolve it.  Please Help!   My existing M in PBIX file (which worked just fine, by the way!)  #"Split Column by Delimiter" = Table.SplitColumn(...
  • Jimmy801's avatar
    Jimmy801
    6 years ago

    Hello Anonymous 

     

    this is what might happen, that you don't have a text string on your whole column, but somewhere at the end a date. And it's not possible to parse a date. So you have to do a transform.columntype of this column before, and change it to text. Did you try this?

     

    Here an example of what happen when you try to split a date

    let
    	Source = #table
    	(
    		{"Date"},
    		{
    			{"03.01.19-04.01.19"},	{"43468"}
    		}
    	),
    	ToDate = Table.TransformColumns(Source, {{"Date", each try Date.From(Number.From(_)) otherwise _}}),
    	Split = Table.SplitColumn(ToDate, "Date", Splitter.SplitTextByAnyDelimiter({"-"}))
    in
    	Split

     

    By the way... you don't need to parse it by "/". Just use a transformColumns with a Date.FromText(_,"en-US") i suppose


    If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
    Kudoes are nice too

    Have fun

    Jimmy