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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
jeongkim
Post Prodigy
Post Prodigy

Dax comparison operations error with advanced full code

Hi

 

Please help to fix my error.

 

jeongkim_0-1732817184751.png

 

 

// Get list of files in SharePoint folder
Documents = Source{[Name="Documents"]}[Content],
// Get list of files in SharePoint folder
#"LGUplus Site Progress" = Documents{[Name="LGUplus Site Progress"]}[Content],
// Get list of files in SharePoint folder
#"TOSS service PO_master" = #"LGUplus Site Progress"{[Name="TOSS service PO_master"]}[Content],
// Get list of files in SharePoint folder
#"Weekly Data" = #"TOSS service PO_master"{[Name="Weekly Data"]}[Content],
#"Removed Other Columns" = Table.SelectColumns(#"Weekly Data",{"Content", "Name"}),
#"Added Custom" = Table.AddColumn(#"Removed Other Columns", "Custom", each Excel.Workbook([Content])),
#"Expanded Custom" = Table.ExpandTableColumn(#"Added Custom", "Custom", {"Name", "Data", "Item", "Kind", "Hidden"}, {"Custom.Name", "Custom.Data", "Custom.Item", "Custom.Kind", "Custom.Hidden"}),
#"Filtered Rows" = Table.SelectRows(#"Expanded Custom", each ([Custom.Hidden] = false) and ([Custom.Kind] = "Sheet")),
#"Removed Other Columns1" = Table.SelectColumns(#"Filtered Rows",{"Name", "Custom.Name", "Custom.Data"}),
#"Sorted Rows" = Table.Sort(#"Removed Other Columns1",{{"Name", Order.Descending}}),
#"Added Custom1" = Table.AddColumn(#"Sorted Rows", "Custom", each Text.Middle([Name],23,8)),
#"Changed Type1" = Table.TransformColumnTypes(#"Added Custom1",{{"Custom", type date}}),
#"Filtered Rows2" = Table.SelectRows(#"Changed Type1", let latest = List.Max(#"Changed Type1"[Custom]) in each [Custom] = latest),
// Dynamically get column names and expand
ColumnNames = Table.ColumnNames(#"Filtered Rows2"[Custom.Data]{0}),
#"Expanded Custom.Data" = Table.ExpandTableColumn(#"Filtered Rows2", "Custom.Data", ColumnNames),
#"Removed Top Rows" = Table.Skip(#"Expanded Custom.Data",2),
#"Promoted Headers" = Table.PromoteHeaders(#"Removed Top Rows", [PromoteAllScalars=true]),
#"Renamed Columns" = Table.RenameColumns(#"Promoted Headers",
{{Table.ColumnNames(#"Promoted Headers"){0}, "Source Name"},
{Table.ColumnNames(#"Promoted Headers"){1}, "Sheet Name"}}),
#"Filtered Rows1" = Table.SelectRows(#"Renamed Columns", each ([Unit price] <> 0)),
#"Changed Type" = Table.TransformColumnTypes(#"Filtered Rows1",{{"Contract signed date", type date}, {"Service#", Int64.Type}, {"Unit price", Int64.Type}, {"Date of list amendment", type date}, {"Total FOC Qty", Int64.Type}, {"Service contract#", Int64.Type}, {"Initial PO amount", Int64.Type}}),
#"Added Index" = Table.AddIndexColumn(#"Changed Type", "Index", 1, 1, Int64.Type),
#"Filtered Rows3" = Table.SelectRows(#"Added Index", each [#"Service#"] <> null and [#"Service#"] <> "")
in
#"Filtered Rows3"

2 REPLIES 2
v-xingshen-msft
Community Support
Community Support

Hi @jeongkim ,
It's been a while since I heard back from you and I wanted to follow up. Have you had a chance to try the solutions that have been offered? If the issue has been resolved, can you mark the post as resolved? If you're still experiencing challenges, please feel free to let us know and we'll be happy to continue to help!
Looking forward to your reply!

Bibiano_Geraldo
Super User
Super User

Hi @jeongkim ,
The error message indicates that there is an issue with comparing text values to integer values, determine which columns are causing the issue.

 

Its not easy to say beacuse we cant see your model.

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors