Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I'm trying to build a DAX function in my table to show value/amount of previous date when the user selects a calendar date which does not exists in my table.
I have tried to create a new table with calendar dates and use the below function but the issue is that,
Date in my main table has duplicates in it so LASTDATE() does not work
and on using MAX() it picks only the maximum value from the group of serials rather than the previous value.
Cost A on nearest date =
VAR myFilterDate =
LASTDATE( 'table'[Date] )
VAR myDate =
LASTDATE(
FILTER(
ALL(Trnx[Date] ),
Trnx[Date] <= myFilterDate
)
)
VAR mySumA =
CALCULATE(
SUM(Trnx[Value]),
FILTER(
ALL(Trnx),
Trnx[Date] = myDate
)
)
RETURN mySumA
Therefore, on above example I want to display 136.80 when selected Date is 10-Mar-20 and 159.60 when selected date is 09-Mar-20.
Do you have any suggestions on how to pick the previous date amount when the user selected slicer date does not exists in the table?
Any help wpuld be much appreciated! @jaidaarellano
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.