PowerBi 中具有多个列引用的自定义列

发布于 2025-01-12 05:16:05 字数 405 浏览 5 评论 0原文

下面是数据集, 输入图片此处描述

我想在数据集末尾添加一个新列作为“Covid No Vaccination Dose”。此列将包括 Covid 疫苗接种剂量 1、Covid 疫苗接种剂量 2、Covid 疫苗接种 - 全剂量和 Covid 疫苗接种 - 加强剂量的填充数据。

因此,基本上在这种情况下,很少有工人没有接种任何疫苗,并且已通过上述栏目确定。

我正在努力将上述 4 个新冠疫苗接种列中的答案“否”填入一个单列,该列将被命名为“新冠疫苗无疫苗剂量”。

如果有人能帮助我,我真的很感激。

Below is the dataset,
enter image description here

I would like to add a new column at the end of the dataset as "Covid No Vaccination Dose". This column will include of the populated data from the Covid Vaccination Dose 1, Covid Vaccination Dose 2, Covid Vaccination - Full Dose and Covid Vaccination - Booster Dose.

So basically in this scenario, there are few workers with No vaccination doses of any of the vaccines and has been identified by the said above columns.

I'm struggling to populate the answer "No" from the above said 4 Covid Vaccination columns to one Single Column which will be named as "Covid No Vaccination Dose".

Really appreciate if anyone can help me with this.

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

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

发布评论

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

评论(2

娇柔作态 2025-01-19 05:16:05

从您的示例来看,单元格似乎将包含 YesNo。在这种情况下,您可以使用具有类似于以下公式的自定义列:

=List.Last(List.Sort(List.Distinct({[Covid Vaccination Dose 1],[Covid Vaccination Dose 2],[#"Covid Vaccination - Full Dose"],[#"Covid Vaccination - Booster Dose"]})))

From your example, it appears that the cells will contain either Yes or No. That being the case, you can use a custom column with a formula similar to the following:

=List.Last(List.Sort(List.Distinct({[Covid Vaccination Dose 1],[Covid Vaccination Dose 2],[#"Covid Vaccination - Full Dose"],[#"Covid Vaccination - Booster Dose"]})))
潦草背影 2025-01-19 05:16:05

如果您在 powerquery 中使用数据

添加列...自定义列...将列名称设置为 Covid No Vaccination Dose

并使用类似于以下的公式:

= if [#"Covid Vaccination - Dose 1"]="No" and [#"Covid Vaccination - Dose 2"]="No" and [#"Covid Vaccination - Full Dose"]="No" and [#"Covid Vaccination - Booster"]="No" then "No" else "Yes"

而不是键入 [...] 部分,我建议您单击它们在右边

If you are in powerquery with the data

Add column ... custom column ... set the column name to Covid No Vaccination Dose

and use formula similar to:

= if [#"Covid Vaccination - Dose 1"]="No" and [#"Covid Vaccination - Dose 2"]="No" and [#"Covid Vaccination - Full Dose"]="No" and [#"Covid Vaccination - Booster"]="No" then "No" else "Yes"

rather then type the [...] parts, I suggest you click on them in the right

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