[英]Countif > 0 in Power Query (Excel)
我有一些股票价格数据及其百分比变化和计算的星期几。
我编辑了一个查询以获得一周中每一天的平均移动(用数字表示)。
在下一步中,我还想计算编号。 在一周中的每一天,股票价格的变化都在 0 以上和 0 以下。
我创建了一个表来查看每天的所有记录
我现在想计算上表中“chg”> 0 的次数以及一周中每一天“chg”<0 的次数。
我尝试添加自定义列 (DaysPositive) =Table.SelectRows([AllRecords], each([chg] > "0"))
但我得到了错误
如果能帮我获得 4 个基本数据点,我将不胜感激
星期几 | 平均 | 上升天数 | 停机天数
在此先感谢任何可以提供帮助的人。
干杯
尝试
let Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Ticker", type text}, {"Day of week", Int64.Type}, {"% avg", type number}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Ticker", "Day of week"}, {
{"belowzero", each Table.RowCount(Table.SelectRows(_, each [#"% avg"] < 0)), type number },
{"abovezero", each Table.RowCount(Table.SelectRows(_, each [#"% avg"] > 0)), type number }
})
in #"Grouped Rows"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.