I have cross posted this question with MR. Excel ;
https://www.mrexcel.com/board/threads/dax-measure-used-in-formula-produces-blank-but-not-when-variable.1220151/
Hi, i have the following measure formula in DAX power pivot to retrieve the previous unit value, I have attached the workbook with examples of each.
so first to get the previous date ;
MAXX(
FILTER(ALL(Table1[Date]),Table1[Date] < IF(HASONEVALUE(Table1[Date]),VALUES(Table1[Date]) ) ),Table1[Date])
Then ;
Previous Unit :=
CALCULATE (
[Tsales],
FILTER (
ALL ( Table1[Date] ),
Table1[Date]
= MAXX (
FILTER (
ALL ( Table1[Date] ),
Table1[Date] < IF ( HASONEVALUE ( Table1[Date] ), VALUES ( Table1[Date] ) )
),
Table1[Date]
)
)
)
So I thought I should be able to use the first measure inside the second,
CALCULATE([Tsales],FILTER(ALL(Table1[Date]),Table1[Date] = [Previous Date] ) )
But this just return a blank? Any explanations as to why?
Bookmarks