在PowerPivot中滚动12个月的总和

编程入门 行业动态 更新时间:2024-10-28 16:19:42
本文介绍了在PowerPivot中滚动12个月的总和的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在PowerPivot Excel 2016中,我写了一个公式,滚动12个月的销售总额如下:

In PowerPivot Excel 2016 I write a formula for rolling 12 month sum of sales as below :

Rolling Sum:=CALCULATE ( [Sales] , DATESBETWEEN ( Sales[Date], FIRSTDATE(DATEADD(Sales[Date],-365,DAY)), LASTDATE (Sales[Date] ) ) )

但似乎不正确。每个月,它只显示了那个月的销售额! 有没有人知道如何解决我的问题?

But it seems not working correctly. for each month it shows me only sales of that month! Does anybody knows how should I fix my problem?!

感谢提前

推荐答案

如果您没有日期/日历表,您不能使用时间智能功能。

If you don't have a Date/Calendar table you can't use Time Intelligence functions properly.

尽管最佳做法有一个日历/日期表,并使用时间智能功能,你可以通过使用显式过滤器获得所需的结果:

Despite the best practice would be have a Calendar/Date table and use Time Intelligence functions, you can get the desired result by using an explicit filter:

Rolling Sum := CALCULATE ( [Sales], FILTER ( ALL ( Sales ), [Date] >= MAX ( Sales[Date] ) - 365 && [Date] <= MAX ( Sales[Date] ) ) )

让我知道这是否有帮助。

Let me know if this helps.

更多推荐

在PowerPivot中滚动12个月的总和

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

发布评论

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

>www.elefans.com

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