问题
Problem with computation of YTD if Data on a particular period is not existing
Using formula
YTDUnits =CALCULATE(SUM(Data[TYUnits]),DATESYTD(Data[FullDate]),ALL(Data[Month])))
Data came from a csv file, and am only using 1 table in the data model.
In this example, Month 2 should have a value of 6 on TransactionType c. Is there a way to fill this?
In the data model, no record exists for TransactionType c Month 2
回答1:
I manually typed in your data sample, and built the data model:
Put Year-Month from the calendar table on the pivot, and added this DAX measure:
YTDUnits = CALCULATE(SUM(Data[TYUnits]), DATESYTD('Calendar'[Date]))
Result:
来源:https://stackoverflow.com/questions/61187301/powerpivot-ytd-with-missing-data