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
tb__
New Member

Can't use DAX and column/field with underscore/dashes in it

I merged two tables. They each have underscores and dashes in their name. The resultant merged table now has underscores in some field names. When I try now to match that new field with another, I get a DAX syntax error message pointing to, not the whole column name, but just up to the first dash. 

 

I tried renaming the column before referencing it in DAX but that apparently doesn't work. I see "Expression.Error: A cyclic reference was encountered during evaluation" but it does not indicate where this cyclical reference is.

 

code (changed var/table/file names) - 

 

let
    Source = Table.NestedJoin(#"table_with-underscores_and-dashes.tsv",{"RawGUID"},#"other-.tsv",{"GUID"},"other-",JoinKind.LeftOuter),
    #"Expanded other_table-with_underscores-and_dahses" = Table.ExpandTableColumn(Source, "other_table.tsv", {"GUID", "Date", "url", "StringToCheck"}, {"other-.GUID", "other-.Date", "other-.url", "other-.StringToCheck"}),
    #"Filtered Rows" = Table.SelectRows(#"Expanded other-", each [#"other-.StringToCheck"] <> null and [#"other-.StringToCheck"] <> ""),
    #"Filtered Rows1" = Table.SelectRows(#"Filtered Rows", each [StringToCheck] <> null and [StringToCheck] <> ""),
    #"Renamed Columns" = Table.RenameColumns(SameLabeles,{{"other-.StringToCheck", "stc"}}),
    #"SameLabeles" = Table.SelectRows(#"Renamed Columns", each Comparer.Equals(Comparer.Ordinal, [StringToCheck], [stc]))
in
    #"SameLabeles"

1 ACCEPTED SOLUTION
tb__
New Member

AH so the issue is that earlier in the code I referenced "SameLabeles" (in #"Renamed Columns") and then I declare #"SameLabeles". Why can't powerBI point this out?

View solution in original post

2 REPLIES 2
tb__
New Member

AH so the issue is that earlier in the code I referenced "SameLabeles" (in #"Renamed Columns") and then I declare #"SameLabeles". Why can't powerBI point this out?

v-huizhn-msft
Employee
Employee

Hi @tb__,

>>When I try now to match that new field with another, I get a DAX syntax error message pointing to, not the whole column name, but just up to the first dash. I tried renaming the column before referencing it in DAX but that apparently doesn't work.

How do you match that new field with another? And what your DAX looks like? Could you please share more details for further analysis?

Best Regards,
Angelia

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.