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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
monojchakrab
Resolver III
Resolver III

List.Accumulate returning wrong value

Hiya all,

 

I am working with a table as below :

 

monojchakrab_0-1678168451301.png

The task is as follows :

1. Extract the month name using List.Accumulate as below :

 Table.AddColumn(ExtractAccountName, "Month Name", each List.Accumulate(MonthNames,
"",
(state,current) =>
if Text.Contains([Name],current,Comparer.OrdinalIgnoreCase) then 
state & "" & current else state))

The {MonthNames} is a list prepared separately and fed here. The result I am getting is a bit of an oddball : the column [MonthName] has an entry "FebMar" and only for one row; but "Mar" is not there in the text in any of the rows.

Is there something I am overlooking here? the Column {Account] is inserted in exactly the same way, without any strange results.

Any help appreciated.

 

 

2 ACCEPTED SOLUTIONS
wdx223_Daniel
Community Champion
Community Champion

in 4th row, right there is a "mar" in Jiomart

View solution in original post

Table.AddColumn(ExtractAccountName, "Month Name", each List.Select(MonthNames,(x)=>
Text.Contains([Name],"_"&x,Comparer.OrdinalIgnoreCase)){0}?)

sorry for my carelessness.

View solution in original post

9 REPLIES 9
monojchakrab
Resolver III
Resolver III

whoops did not realise that @wdx223_Daniel . Is there a workaround not to pick up the "mar" from the name of the account string.

would splitting the column using the delimiter "-" work better in this case?

Table.AddColumn(ExtractAccountName, "Month Name", each List.Select(MonthNames,each
Text.Contains([Name],"_"&_,Comparer.OrdinalIgnoreCase){0}?)

@wdx223_Daniel - It adds column with lists as it should, but the list is populated with errors on every row. Am I getting something wrong?

@wdx223_Daniel 

This is the error message :

monojchakrab_0-1678176443022.png

 

Table.AddColumn(ExtractAccountName, "Month Name", each List.Select(MonthNames,(x)=>
Text.Contains([Name],"_"&x,Comparer.OrdinalIgnoreCase){0}?)

@wdx223_Daniel :

 

Now the error message is as below :

 

monojchakrab_0-1678177032573.png

Because probably the "text.contains", in this case will return a true, right?

Thanks for being in my corner. really appreciate.

Table.AddColumn(ExtractAccountName, "Month Name", each List.Select(MonthNames,(x)=>
Text.Contains([Name],"_"&x,Comparer.OrdinalIgnoreCase)){0}?)

sorry for my carelessness.

That worked !! @wdx223_Daniel . Thanks a ton.

wdx223_Daniel
Community Champion
Community Champion

in 4th row, right there is a "mar" in Jiomart

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.