如何过滤表以不同的值PowerApps

发布于 2025-01-28 05:14:10 字数 93 浏览 2 评论 0 原文

我是PowerApps的新手,我注意到独特的函数返回一个不同值的表(仅返回独特的列而不是完整行)。是否有一种方法可以过滤表,以便它返回完整表的子集,其中指定列中具有不同值。

I am new to Powerapps and I have noticed that the Distinct function returns a table of the distinct values(only returns the distinct column not the full row). Is there a way to filter a table so that it returns back a subset of the full table with distinct values in a specified column.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

哀由 2025-02-04 05:14:10

您可以为此使用GroupBy函数。看看文档下面的示例:

假设 Cities 是一张具有以下价值的表:

城市 国家 人口
伦敦 英国 8615000
柏林 德国 3562000
PARAS 法国 2874000
马德里西班牙3165000罗马 意大利 法国
2273000 汉堡 德国
1760000 BARCELONA 1760000
BARCELONA SPIAN SPIAN SPIAN SPIAN SPIAN 1602000 MILAN MILAN MILAN SPIAN
MILAN MILAN ITALA MILAN ITALA MILAN ITALA
MILAN ITALA MILAN ITALIAN 1344000

表达式 groupby(城市,“乡村”,“城市”)将返回带有“ country”的表,以及一个名为“城市”的列,其价值将为 带有的表格该国的所有城市

然后,您可以使用功能,例如 sum ,如下示例:

AddColumns(
    GroupBy(cities, "Country", "Cities"),
    "Sum of City Populations",
    Sum(Cities, Population))

在您的推文示例中,如果您想从每天获得一条推文,则可以具有下面的表达式:

AddColumns(
    GroupBy(Tweets, "crf1d_date_index", "Dates"),
    "SampleTweet",
    First(Dates))

在每个日期起,它将具有新的列,并带有第一条推文。或者,如果您想要组中的一个字段,则可以拥有类似的东西:

AddColumns(
    GroupBy(Tweets, "crf1d_date_index", "Dates"),
    "FirstTweetTime",
    First(Dates).tweet_time)

You can use the GroupBy function for this. Take a look at the documentation, or in the example below:

Assuming that cities is a table with the following values:

City Country Population
London UK 8615000
Berlin Germany 3562000
Madrid Spain 3165000
Rome Italy 2874000
Paris France 2273000
Hamburg Germany 1760000
Barcelona Spain 1602000
Munich Germany 1494000
Milan Italy 1344000

The expression GroupBy(cities, "Country", "Cities") will return a table with a column "Country", and a column called "Cities" whose value will be a table with all cities for that country.

You can then use functions such as AddColumns and Sum to aggregate the values of the inner table, like in the example below:

AddColumns(
    GroupBy(cities, "Country", "Cities"),
    "Sum of City Populations",
    Sum(Cities, Population))

In your tweets example, if you want to get one tweet from each day, you can have an expression like the one below:

AddColumns(
    GroupBy(Tweets, "crf1d_date_index", "Dates"),
    "SampleTweet",
    First(Dates))

Where it would have a new column with the first tweet from each date. Or if you want a single field from the group, you can have something like this:

AddColumns(
    GroupBy(Tweets, "crf1d_date_index", "Dates"),
    "FirstTweetTime",
    First(Dates).tweet_time)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文