我使用功率Bi的快速测量MoM%:
VAR __PREV_MONTH =
CALCULATE(
AVERAGE('DAUMAU'[MAU]),
DATEADD('DAUMAU'[login_date], -1, MONTH)
)
RETURN
DIVIDE(
AVERAGE('DAUMAU'[MAU]) - __PREV_MONTH,
__PREV_MONTH
)
我使用的是折线堆叠的柱形图,因此无法加载该视觉效果的数据:
度量____中的计算错误:函数“ DATEADD”期望 当日期列来自表格上的表格时的连续选择 双向关系的一面。
我还需要确保在视觉中排除了当前月份。我应该修改代码还是应用过滤器?如果是后者,如何使用我的日期列指定排除当前月份。我尝试将其添加到视觉过滤器中,并查看了高级,相对和选择性过滤器,但是如果没有我每月手动更改它,它将无法正常工作。
答案 0 :(得分:1)
In order for the time intelligence functions to work properly, they require you to have a date table that is contiguous and contains a unique row for every day in the years in use.
You can create a minimal table in DAX using CALENDAR
or CALENDARAUTO
or you can use a template to create on in the query editor or as a calculated table.
Here's a reference to a template that probably has anything you'd ever need: https://www.sqlbi.com/articles/reference-date-table-in-dax-and-power-bi/