Forum Discussion
Comparing current vs last year sales - multiple date columns
- Anonymous6 years ago
Hi Anonymous ,
Pbix as attached, hopefully works for you.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Well, let's match up the parens:
Measure 2 =
VAR TheChosenOne = SELECTEDVALUE('Date'[Date])
return
sumx(
filter(
table,
table[As of date]<=
DATE(
year(TheChosenOne)-1,
month(TheChosenOne),
day(TheChosenOne)
)
),
table[Count 2020]
)
Found it!
Thank you for checking Greg_Deckler .
I got the following error in the output table: Can't display the visual:
MdxScript(Model) (133,44) Calculation error in message ('table'[Measure 2]: An argument of function 'DATE' has the wrong data type or the result is too large or too small.
I changed the value type to Whole number, and I'm still getting the error.
Can you please check?
- Greg_Deckler6 years ago
Community Champion
Are you getting this with nothing selected in your Date slicer? Probably need to return some date value using the optional parameters for SELECTEDVALUE to return a default?- Anonymous6 years agoNot applicable
I'm getting the message with both date selected, and no date selected in the slicer.