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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Peppermint_T
Frequent Visitor

Expression.Error: The column 'IsCracked' of the table wasn't found.

My data is flowing from azure blob to PowerBI.

I am applying a series of data prep/cleaning in databricks. The result is a dataframe with 23 columns.

The column called "IsCracked" definitely exists in the csv in blob. It is a boolean T/F value.

PowerBI is connecting to azure blob; access key in place.

 

The advanced editor script is below. And the error points me to the "Changed Type" line:

#"Promoted Headers" = Table.PromoteHeaders(#"Imported CSV", [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"", Int64.Type}, {"Category", type text}, {"Crack_Location", type text}, {"Date_Captured", type datetime}, {"Repair_Type", type text},
{"Unit", Int64.Type}, {"mm_1", Int64.Type}, {"mm_10", Int64.Type}, {"mm_2", Int64.Type}, {"mm_3", Int64.Type}, {"mm_4", Int64.Type}, {"mm_5", Int64.Type}, {"mm_6", Int64.Type}, {"mm_7", Int64.Type},
{"mm_8", Int64.Type}, {"mm_9", Int64.Type}, {"total_length", Int64.Type}, {"Largest_Crack", Int64.Type}, {"Largest_Crack_%_of_Total", Int64.Type}, {"Unit_Location", type text}, {"IsRepaired", type logical},
{"Crack_Count", Int64.Type}, {"IsCracked", type logical}}),
#"Extracted Text After Delimiter" = Table.TransformColumns(#"Changed Type", {{"Unit_Location", each Text.AfterDelimiter(_, "U_"), type text}}),
#"Added Conditional Column" = Table.AddColumn(#"Extracted Text After Delimiter", "IsCrackedLogicasNumber", each if [total_length] > 1 then 1 else 0),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Conditional Column",{{"IsCrackedLogicasNumber", Int64.Type}}),
#"Added Conditional Column1" = Table.AddColumn(#"Changed Type1", "IsRepairedasNumber", each if [IsRepaired] = true then 1 else 0),
#"Changed Type2" = Table.TransformColumnTypes(#"Added Conditional Column1",{{"IsRepairedasNumber", Int64.Type}})
in
#"Changed Type2"

 

Tried refreshing, resetting access keys, double checking my code in databricks, the cols exist in the azure blob.

Grateful for any suggestions.

 

1 ACCEPTED SOLUTION

If your data source has variable column count then I recommend you remove the columns=xxx part from the M code.

View solution in original post

4 REPLIES 4
Peppermint_T
Frequent Visitor

Thanks for the pointer Ibendlin. I made some progress - I needed to update the number of columns and the column names in the Advanced Editor. I had added a column to the table I was creating in Databricks/Azure and sending it to PowerBI. PowerBI did not pick that up and I needed to update the M script.  I will have a look at try and ? re conditionally working with cols as you suggest.

If your data source has variable column count then I recommend you remove the columns=xxx part from the M code.

Thanks for the tip.

lbendlin
Super User
Super User

While you figure out the discrepancy, learn about conditionally working with columns that may or may not be there , or that may or may not have a value.  Check "try...otherwise" and the "?" operator.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors