powerbi - how to change a specific cell in Power Query (M Language)? - Stack Overflow

I need to append few excel files into Power Query. But overall there is one cell ("Custom1" R

I need to append few excel files into Power Query. But overall there is one cell ("Custom1" Row=6) which should be assign as "Bla". How to get around with this using power query ? many thanks in advance.

ps: ("Custom1" Row=6) has a different text value for each excel file.

I need to append few excel files into Power Query. But overall there is one cell ("Custom1" Row=6) which should be assign as "Bla". How to get around with this using power query ? many thanks in advance.

ps: ("Custom1" Row=6) has a different text value for each excel file.

Share Improve this question asked Nov 20, 2024 at 17:40 Seyma KalaySeyma Kalay 2,86116 silver badges39 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1
  • Add Index column
  • Use Table.ReplaceValue to replace the cell in the appropriate column/row
    • Note I used Index=5 as the column as I chose to add zero-based Index column.
  • Remove the Index column
#"Added Index" = Table.AddIndexColumn(#"Added Custom1", "Index", 0, 1, Int64.Type),
    
    #"Replace with Bla" = Table.ReplaceValue(
        #"Added Index",
        each [Index],
        null,
        (x,y,z)as nullable text=> if y=5 then "Bla" else x,
        {"Custom1"}),
    
    #"Removed Columns" = Table.RemoveColumns(#"Replace with Bla",{"Index"})

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742339978a4425426.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信