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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
mike_asplin
Advocate II
Advocate II

Expression.Error: We cannot apply field access to the type Null.

I have a table with 40 columns that contain either null or Y for each row. I'd like to count how many "Y" there are. I found some help from other posts, but doesnt seem to work.

 

My calcuated column is with a few of the columns

 

= Table.AddColumn(#"Replaced Value", "Custom", each List.Count(List.Select({[#"Service type - Acute services with overnight beds"],[#"Service type - Acute services without overnight beds / listed acute services with or without overnight beds"],[#"Service type - Ambulance service"],[#"Service type - Blood and Transplant service"],[#"Service type - Care home service with nursing"],[#"Service type - Care home service without nursing"],[#"Service type - Community based services for people who misuse substances"][#"Service type - Community based services for people with a learning disability"]}, each _ ="Y")))

  

but this throws the error

Expression.Error: We cannot apply field access to the type Null.
Details:
Value=
Key=Service type - Community based services for people with a learning disability

 

I tried replacing the null with N in this specific column but same error

 

Any help appreciated as sure its a small thing

 

Thanks

 

1 ACCEPTED SOLUTION
Shahid12523
Community Champion
Community Champion

Expression.Error: We cannot apply field access to the type Null

 

is caused by a missing comma between two field references inside your list. Specifically, this part

 

[#"Service type - Community based services for people who misuse substances"][#"Service type - Community based services for people with a learning disability"]

 

 

= Table.AddColumn(#"Replaced Value", "Custom", each
List.Count(
List.Select({
[#"Service type - Acute services with overnight beds"],
[#"Service type - Acute services without overnight beds / listed acute services with or without overnight beds"],
[#"Service type - Ambulance service"],
[#"Service type - Blood and Transplant service"],
[#"Service type - Care home service with nursing"],
[#"Service type - Care home service without nursing"],
[#"Service type - Community based services for people who misuse substances"],
[#"Service type - Community based services for people with a learning disability"]
}, each _ = "Y")
)
)

 

 

Shahed Shaikh

View solution in original post

2 REPLIES 2
mike_asplin
Advocate II
Advocate II

what a donkey. Thanks so much

Shahid12523
Community Champion
Community Champion

Expression.Error: We cannot apply field access to the type Null

 

is caused by a missing comma between two field references inside your list. Specifically, this part

 

[#"Service type - Community based services for people who misuse substances"][#"Service type - Community based services for people with a learning disability"]

 

 

= Table.AddColumn(#"Replaced Value", "Custom", each
List.Count(
List.Select({
[#"Service type - Acute services with overnight beds"],
[#"Service type - Acute services without overnight beds / listed acute services with or without overnight beds"],
[#"Service type - Ambulance service"],
[#"Service type - Blood and Transplant service"],
[#"Service type - Care home service with nursing"],
[#"Service type - Care home service without nursing"],
[#"Service type - Community based services for people who misuse substances"],
[#"Service type - Community based services for people with a learning disability"]
}, each _ = "Y")
)
)

 

 

Shahed Shaikh

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors