Power BI: Percent Change Formula

半城伤御伤魂 提交于 2019-12-02 08:28:47

As Alexis mentioned, there is no concept of referring to a specific row in DAX. It can be a hard notion for people who are used to Excel, but if you want to take advantage of PowerBi, you will have to "unlearn" Excel way of thinking.

To accomplish your goal, you need to do some data modeling first. As a common practice, replace your "Date" column with a proper Calendar table:

Calendar table explained

As a result, you will have a data model in PowerBi that looks something like this:

Once you have such structure in place, DAX is simple:

Current Month Cost = SUM(Expenses[Cost])

Previous Month Cost = CALCULATE( [Current Month Cost], PREVIOUSMONTH(Calendar[Date]))

% Change = DIVIDE( [Current Month Cost] - [Previous Month Cost], [Previous Month Cost])
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!