缺少数据的 PowerPivot YTD [英] PowerPivot YTD with Missing Data
问题描述
如果特定时期的数据不存在,则 YTD 计算有问题
Problem with computation of YTD if Data on a particular period is not existing
使用公式
YTDUnits =CALCULATE(SUM(Data[TYUnits]),DATESYTD(Data[FullDate]),ALL(Data[Month])))
数据来自一个 csv 文件,我只使用了数据模型中的 1 个表.
Data came from a csv file, and am only using 1 table in the data model.
在此示例中,第 2 个月在 TransactionType c 上的值应为 6.有没有办法填补这个?
In this example, Month 2 should have a value of 6 on TransactionType c. Is there a way to fill this?
在数据模型中,不存在 TransactionType c Month 2 的记录
In the data model, no record exists for TransactionType c Month 2
推荐答案
我手动输入了你的数据样本,并构建了数据模型:
I manually typed in your data sample, and built the data model:
将日历表中的 Year-Month 放在数据透视表上,并添加此 DAX 度量:
Put Year-Month from the calendar table on the pivot, and added this DAX measure:
YTDUnits = CALCULATE(SUM(Data[TYUnits]), DATESYTD('Calendar'[Date]))
结果:
这篇关于缺少数据的 PowerPivot YTD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!