This is cross posted with Excel Forum; DAX Using a Measure in formula produces a blank and can't see why
My question relates to the following formula to get the previous value from non consec dates; first I have a filtered down table.
and then ;
Can someone explain why I have to declare the Filtered dates measure as a variable, if I use it directly, I get a blank, I've tried using studio to get an idea
of what's happening but without much success.
Richard.
My question relates to the following formula to get the previous value from non consec dates; first I have a filtered down table.
Excel Formula:
Filtered Dates :=
MAXX (
FILTER (
ALL ( Table1[Date] ),
Table1[Date] < IF ( HASONEVALUE ( Table1[Date] ), VALUES ( Table1[Date] ) )
),
Table1[Date]
)
and then ;
Excel Formula:
M as VAR Previous Unit :=
VAR FDs = [Filtered Dates]
VAR PrevU =
CALCULATE ( [Tsales], FILTER ( ALL ( Table1[Date] ), Table1[Date] = FDs ) )
RETURN
PrevU
Can someone explain why I have to declare the Filtered dates measure as a variable, if I use it directly, I get a blank, I've tried using studio to get an idea
of what's happening but without much success.
Richard.