PowerBi - 如何在矩阵中显示多个总列?
I have a slicer from which I can select weeks that I want to show on a matrix. Currently, the matrix only shows the total column at the end of all columns basically summing up all the values.
But I want to show multiple total column (One after each month). Like after the End Of Weeks of one month a total column and so on.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不能简单地创建
计算的列
或MEATUR
来解决此问题。实际上,您可以使用计算的列
使用一些逻辑,但是有一种更有效的方法。为了实现目标,您必须根据日期列创建计算的表
。您可以使用该逻辑为视觉效果创建任何自定义标签。在我们开始在这里深入DAX之前,让我们创建一个日历表。
现在,当我们拥有带有日期和其他字段的表格时,我们可以开始为此特定情况创建解决方案。
创建一个新的计算表如下:
请注意,DAX上面的最后一部分添加
total
是可选的。创建表后,转到数据视图,选择
customCategories
表,选择标签
列,然后按labelsorter对列进行排序
(您将在功能区找到一个选项)。然后返回到您的模型视图,并在customCategories
和date> date
列之间设置一个关系。完成上述所有内容后,请切换回报告视图。从表Visual中删除日期列,然后用新创建的
Label
从CustomCategories
表替换它。现在,您应该看到所需的结果。
希望有帮助!
问候,
arek
You cannot simply create a
Calculated column
orMeasure
to solve this problem. Actually, you can use some logic withCalculated column
, but there is a more efficient way. To achieve the goal, you have to createCalculated table
based on your date column. You can use that logic to create any custom label for your visuals.Before we start diving into deep DAX here, let's create a calendar table.
Now, when we have the table with our dates and additional fields, we can start creating a solution for this particular case.
Create a new calculated table as follows:
Note that the last part of above DAX adding
Total
is optional.Once the table has been created, go to the Data view, select
CustomCategories
table, selectLabel
column and sort the column byLabelSorter
(you will find an option on the ribbon). Then go back to your Model view and set a relationship betweenCustomCategories
and your Fact table onDate
column.When you have done with all stuff above, switch back to the Report view. Remove the date column from your table visual and replace it with the newly created
Label
fromCustomCategories
table.Now you should see the desired results.
Hope that helps!
Regards,
Arek