如何计算切片机上选定月份的销售额? [英] How to calculate sales for selected months on slicer?

查看:73
本文介绍了如何计算切片机上选定月份的销售额?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Excel 2016中使用Power Pivot中的Adventureworks数据库。我想计算从第一个月开始的一年中特定月份的销售额(Jan) )在切片机上选择的任何月份,其可以是"Jan","Feb"和"Feb"。或1,
2,9格式。

I am using Adventureworks database in Power Pivot in Excel 2016. I want to calculate sales only for specific months in a year starting from the first month (Jan) to any month that is selected on slicer which can be a "Jan", "Feb" OR 1, 2, 9 format.

我写了以下措施,但每次我想看到不同的月份,我都需要更改DAX指标。

I have written the following measure but every time I want to see a different month I need to change the DAX measure.

TillSeptemberSales:=

CALCULATE([TotalSales],'Calendar'[MonthNo]> = 1& &'Calendar'[MonthNo]< = 9)

TillSeptemberSales :=
CALCULATE ( [TotalSales], 'Calendar'[MonthNo] >= 1 && 'Calendar'[MonthNo] <= 9 )

我尝试了以下一个但失败了,因为它引发了错误

I tried the following one but failed as it is throwing an error

TillSeptemberSales:=

CALCULATE([TotalSales],'Calendar'[MonthNo]> = 1&&'Calendar'[MonthNo]< = [SelectedMonthNo])

TillSeptemberSales :=
CALCULATE ( [TotalSales], 'Calendar'[MonthNo] >= 1 && 'Calendar'[MonthNo] <= [SelectedMonthNo] )

任何更好的解决方案?

提前致谢

ArjunMShetty

ArjunMShetty

推荐答案

为此您可以使用
TOTALYTD
 (年初至今=年初至今)
For this you can use TOTALYTD (YTD = Year to date)


这篇关于如何计算切片机上选定月份的销售额?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆