Forum Discussion

Samarth-Borade's avatar
Samarth-Borade
Frequent Visitor
3 years ago

Display new Routes compared to Previous month

prev =
var curr= CALCULATETABLE(VALUES(ff[Route Path]),SELECTEDVALUE(ff[Trip Date].[MonthNo]))
var past= CALCULATETABLE(VALUES(ff[Route Path]),DATEADD(ff[Trip Date].[MonthNo],-1,MONTH))
var exc= EXCEPT(curr,past)
return
    exc
 
error:The True/False expression does not specify a column. Each True/False expressions used as a table filter expression must refer to exactly one column.
 
Help me with this

5 Replies

  • Samarth-Borade  try with filter , user below dax query.

    prev =
    var curr= CALCULATETABLE(VALUES(ff[Route Path]),Filter(TabelName,SELECTEDVALUE(ff[Trip Date].[MonthNo])))
    var past= CALCULATETABLE(VALUES(ff[Route Path]),Filter(TabelName,DATEADD(ff[Trip Date].[MonthNo],-1,MONTH)))
    var exc= EXCEPT(curr,past)
    return
        exc


     
    **If this post helps, please consider accept as solution to help other members find it more quickly and Appreciate your Kudos.
    • Samarth-Borade's avatar
      Samarth-Borade
      Frequent Visitor

      Error!
      MdxScript(Model) (39, 59) Calculation error in measure 'ff'[prev]: A column specified in the call to function 'DATEADD' is not of type DATE. This is not supported.

       

      • Mahesh0016's avatar
        Mahesh0016
        Super User

        Samarth-Borade 

        Exceptdata =
        VAR Curr = CALCULATETABLE(VALUES(TrainingSample2[Category]),FILTER(TrainingSample2,SELECTEDVALUE(TrainingSample2[SalesDate])))
        VAR Past = CALCULATETABLE(VALUES(TrainingSample2[Category]),FILTER(TrainingSample2,DATEADD(TrainingSample2[SalesDate],-1,MONTH)))
        RETURN
        EXCEPT(Curr,Past)