Forum Discussion
Declaring a data type power query
Hi randymone
Maybe the data coming from the source has a different locale that what your PBIX has? For example, decimal seperators from the source are . and your pbix is , this in my expierence causes issues
If this is the case, highlight all columns with a value in it and replace the . with , or change the locale in your PBIX
Hope fully this helps
Joe
If this post helps, then please Accept it as the solution
Thanks for the response.
This is a personal project and I am not using PowerBI, only Power Query. The regional settings for the current workbook indicate the United States. Transactions, the source of the data, is another Power Query which transforms the uploaded raw data. The columns were renamed in #"Renamed Columns" to be consistent with the the code i found on the internet.
In debugging a bit further, it appears the issue is with the code:
try
if [Type] = "S" then List.Sum( List.FirstN( List.Skip(lCost, pSell), u)) else null
otherwise null
which appears to create the null for the Cost Sold. (I changed it to otherwise "xxx" which was the result for a sale transaction.)
I am not sophisticated enough to parse the code to be able to see what happens in the individual steps (and see what the values are being used for lcost, psell, and U.) to troubleshoot the issue.
Wondering whether the List.Skip function would ever provide a result if the data types being used are inconsistent.
Any insight would be appreciated.
Randymone