缺少数据的 PowerPivot YTD [英] PowerPivot YTD with Missing Data

查看:49
本文介绍了缺少数据的 PowerPivot YTD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果特定时期的数据不存在,则 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屋!

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