问题描述
我在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
推荐答案
这篇关于如何计算切片机上选定月份的销售额?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!