如何过滤来自 PowerApps excel sheet 的下拉菜单中的不同值?

How can I filter distinct values on a dropdown menu coming from an excel sheet on PowerApps?

我有一个下拉菜单,它访问名为 Clothes 的 Excel sheet 并从列 Color 中获取不同的值,然后按升序对它们进行排序使用以下语句订购:

Sort(Distinct(Clothes,Color),Result,Ascending) 

我的 Color 列包含以下值:

Green
Blue
Grey
Red
Yellow
Pink

我想做的是在下拉列表中过滤其中包含颜色字母 g 的颜色。例如,我想在应用过滤器后只看到 GreenGrey。我尝试了以下方法:

Sort(Distinct(Filter(Clothes, "g" in Lower(Color))),Result,Ascending) 

但我收到一条错误消息:

The function 'Sort' has some invalid arguments. Invalid number of arguments 
received 1, expected: 2

有人可以帮助我理解我做错了什么吗?提前感谢您提供的任何帮助

您的 distinct 函数似乎缺少必需的参数!根据找到的 Distinct 参考文档 here,Distinct 函数采用 Table 参数和 Formula 参数。您的 Table 参数是应用过滤器的结果,公式可能类似于您试图从中获取不同值的列名。在你的情况下,很可能 'Clothes'.

Sort(Distinct(Filter(Clothes, "g" in Lower(Color)), <Formula goes here>),Result, Ascending)

这是来自上述文档的有关 Distinct 工作原理的示例。

例子

如果您有一个包含部门列的员工 table,此函数将列出该列中每个唯一的部门名称,无论每个名称在该列中出现多少次:

不同(员工、部门)