在 Power BI 中显示为另一列的百分比

编程入门 行业动态 更新时间:2024-10-25 22:25:50
本文介绍了在 Power BI 中显示为另一列的百分比的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一张看起来像这样的桌子

I have a table that looks like this

| Date | Total | Loss | |---------------------|---------|--------| | Jan 1 2018 | 90 | 5 | |---------------------|---------|--------| | Jan 3 2018 | 10 | 5 | |---------------------|---------|--------| | Feb 1 2018 | 50 | 5 | |---------------------|---------|--------| | Feb 3 2018 | 50 | 10 | |---------------------|---------|--------|

我希望能够在表格中显示总"损失"的百分比取决于时间段.

I wanna be able to show in a table how much percentage of "Total" "Loss" is depending on the period.

例如,如果在我的仪表板中我将表格可视化器显示为月份,它应该给出:

For example if in my dashboard I show the table visualizer as months, it should give :

| Date | Loss % | |---------------------|---------| | Jan 2018 | 10% | |---------------------|---------| | Feb 2018 | 15% | |---------------------|---------|

但是如果我把它显示为年份,它应该给出:

But if I show it as year, it should give :

| Date | Loss % | |---------------------|---------| | 2018 | 12.5% | |---------------------|---------|

现在我找到的唯一解决方案是在数据"选项卡中创建表格,以汇总每个月的主表格.但这对我来说不是一个永久的解决方案(我最终有太多的表,因为我必须为许多不同的列和相互冲突的关系做那种表).

Right now the only solution I have found is to create tables in the Data tab that would sum up my main table for each Month. But that can't be a permanent solution to me (I end up with too many tables, as I have to do that kind of table for many different columns and conflicting relationships).

推荐答案

我通过将以下度量添加到您的表中获得了相同的结果 LossPercent = 100 * SUM(SalesData[Loss])/SUM(SalesData[Total]),然后添加日期和日期表之间的关系,其中包含将日期细分为要显示的分组.

I achieved the same result by adding the following measure to your table LossPercent = 100 * SUM(SalesData[Loss]) / SUM(SalesData[Total]), then adding a relationship between the date and a Dates table, which contains a breakdown of dates into the groupings you want to display.

更多推荐

在 Power BI 中显示为另一列的百分比

本文发布于:2023-10-30 08:04:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1542261.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:百分比   Power   BI

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!