Forum Discussion
issue = Generate Series function cannot be blank.
The code you provided is trying to extract the numeric values from the 'RawData'[Period12] column. It does this by iterating over each character in the string and checking if it's a number. If it is, it concatenates it to form the final number.
Now, the error you're seeing, "Generate Series function cannot be blank", typically arises when the GENERATESERIES function doesn't get the expected input for its start and end values. In your code, the GENERATESERIES function is using 1 as the start value and __stringLength as the end value. This means that if __stringLength is blank or zero, you'll get this error.
Given that the code works when you remove the 'BUD2023' year, it's possible that there's something about the data for that year that's causing the issue. Here are a few things to consider:
1. Check if there are any blank or NULL values in the 'RawData'[Period12] column for the 'BUD2023' year. If there are, this could be causing the __stringLength variable to be zero, which would trigger the error.
2. It's also possible that there's a non-standard character or space in the 'BUD2023' data that's affecting the LEN function's ability to correctly calculate the string length.
3. Ensure that the 'RawData'[Period12] column for 'BUD2023' is formatted consistently with the other years. If there's a change in the way the data is formatted, it could affect the way the code parses the numbers.
To troubleshoot, you might want to create a simple measure or column that just calculates the __stringLength for each row. This will allow you to quickly identify any rows where the length is zero or not what you'd expect. From there, you can investigate those specific rows to see what might be causing the issue.
Lastly, if you're still stuck, consider sharing a sample of the 'RawData'[Period12] data for the 'BUD2023' year. Sometimes, seeing the actual data can help identify issues that might not be immediately obvious from the code alone.