Hello @Vincent Diallo-Nort
Thanks for the ask and using Microsoft Q&A platform .
Your ask was
So I was expecting to see 15,502.99 on the column "Last non blank" for the date 2007-02-07. Any idea what I am missing ?
I am confused I think the ask should be
So I was expecting to see 15,502.99 on the column "Last non blank" for the date 2007-02-08. Any idea what I am missing ?
If thats the case , please use the below query .
-- FIRSTNONBLANKVALUE and LASTNONBLANKVALUE return the first and last
-- non blank values in the selection.
DEFINE
MEASURE Sales[Sales Amount Prev] =
CALCULATE ( [Sales Amount], PREVIOUSDAY ( 'Date'[Date] ) )
MEASURE Sales[Sales Amount Prev non] =
VAR LastAmount =
CALCULATE (
MAX ( 'Date'[Date] ),
FILTER ( ALL ( 'Date'[Date] ), 'Date'[Date] < MAX ( 'Date'[Date] ) )
)
VAR result =
CALCULATE ( [Sales Amount], 'Date'[Date] = LastAmount )
RETURN
if ([Sales Amount]=BLANK (),result,[Sales Amount])
EVALUATE
CALCULATETABLE (
ADDCOLUMNS (
VALUES ( 'Date'[Date] ),
"Sales Amount", [Sales Amount],
"last non blank ", Sales[Sales Amount Prev non]
),
'Date'[Date] >= DATE ( 2007, 2, 7 )
&& 'Date'[Date] <= DATE ( 2008, 2, 16 )
)
ORDER BY 'Date'[Date]
Please do let me know how it goes .
Thanks
Himanshu
- Please don't forget to click on or upvote button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
- Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators