我想返回一行的最大值,然后返回标题

问题描述 投票:0回答:1

我希望能够返回一行的最大日期,但我想返回列的标题而不是实际日期。 但是,我希望它写标题而不是日期。例如,我想要第一行有一列显示“退出”。因为它包含该行的最大值

enter image description here

powerbi powerquery
1个回答
1
投票

在 powerquery 中,添加列 .. 自定义列 .. 带公式

= let a = Record.FieldValues(_) in Record.FieldNames(_){List.PositionOf(a,List.Max(a))}

enter image description here

仅搜索指定列

let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
search = {"Column1","Column2","Column3"},
#"Added Custom" = Table.AddColumn(Source, "Custom", each let a = Record.FieldValues(_) in Record.FieldNames(_){List.PositionOf(a,List.Max(Record.ToList(Record.SelectFields(_,search))))})
in #"Added Custom"
© www.soinside.com 2019 - 2024. All rights reserved.