Forum Discussion

NYCDOT's avatar
NYCDOT
Regular Visitor
10 months ago
Solved

I"m issue with power bi dax code with error cannot find name

Please help. Here is the code: Weekday_comparison_table = VAR Weekdays =                 SELECTCOLUMNS(                     GENERATESERIES(1, 7)                     ,"WeekdayNumber", [Value] ...
  • rohit1991's avatar
    rohit1991
    10 months ago

    Hii NYCDOT 

     

    The error occurs because WeekdayNumber is a virtual column created by SELECTCOLUMNS() and exists only in row context. Inside CALCULATE(), filters are evaluated in filter context, so the column cannot be resolved by name. The fix is to store [WeekdayNumber] in a variable and use that variable inside CALCULATE().