Forum Discussion

bsheffer's avatar
bsheffer
Continued Contributor
4 years ago
Solved

why is this not a valid table

I'm trying to use this variable in an IN statement in a calculate

 

var _months_selected = calculate(VALUES('Dim Calendar ActivityMonth'[MonthNo]), allselected('Dim Calendar ActivityMonth'))

 

but when I use it in this clause it says it isn't a valid table

 

month('Dim Calendar ActivityMonth'[Date]) in _months_selected
 
what's the correct syntax?
  • Hi bsheffer 
    If you want to create a table you should use CALCULATETABLE not CALCULATE.

    If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

    Best regards,

    Jeroen

1 Reply

  • jeroendekk's avatar
    jeroendekk
    Responsive Resident

    Hi bsheffer 
    If you want to create a table you should use CALCULATETABLE not CALCULATE.

    If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

    Best regards,

    Jeroen