Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
F_Reh
Helper IV
Helper IV

SPC Chart Error - Cannot Read Properties of Null (reading 'length')

Good Afternoon,

 

I am using an SPC control (which I have imported in)....When I assign fields to both Outcome/Numerator and ID Key (Date) there is no problem. But when I add the Indicator-signifying field  - which is of Text type - to Grouping (Summary Table) I get the following error:

 

"Cannot Read properties of null (reading 'length')

 

F_Reh_0-1735045416810.png

 

Kindly advise how I can resolve this.

 

Regards

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @F_Reh ,

This error message in Power BI, "Cannot read properties of null (reading 'length')," typically occurs when the code is trying to access the length property of a variable that is null or undefined.

 

I think you can do these things following:

 

1. Ensure that all data sources are correctly connected and that there are no null values where the code expects data.

 

2. Review your DAX expressions to ensure they handle null values properly. You might need to use functions like IF, ISBLANK, or COALESCE to manage null values.

 

3. You can also refer to the official SPC Chart documentation:

Business Apps – Microsoft AppSource

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
F_Reh
Helper IV
Helper IV

I tried Coalesce function but it did not rectify the issue. The field used for Grouping (Summary Table)  is called 'Data Records'[Outcomes] is actually of Text type (perhaps that was the cause of the issue when used in conjunction with Coalesce ?).  

 

I have more or less resolved the issue now as follows:

 

By creating a new calculated column with the following expression:  

 
Outcomes = IF(ISBLANK('Data Records'[Outcomes]),"N/A",'Data Records'[Outcomes])
 
Which removes the NULLs.
 
And for ID Key (Date), instead of using the actual field Month_year, I used the Date hierarchy for it i.e  Year, Quarter, Month and Day.  I am intrigued to comprehend why the issue persists when using Month_Year on its own.
 
F_Reh_0-1735555124085.png

 

F_Reh_1-1735555215011.png

 

 

Regards

Anonymous
Not applicable

Hi @F_Reh ,

This error message in Power BI, "Cannot read properties of null (reading 'length')," typically occurs when the code is trying to access the length property of a variable that is null or undefined.

 

I think you can do these things following:

 

1. Ensure that all data sources are correctly connected and that there are no null values where the code expects data.

 

2. Review your DAX expressions to ensure they handle null values properly. You might need to use functions like IF, ISBLANK, or COALESCE to manage null values.

 

3. You can also refer to the official SPC Chart documentation:

Business Apps – Microsoft AppSource

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

elitesmitpatel
Solution Supplier
Solution Supplier

please share the dummy data pbix file for easy reference

 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.