Forum Discussion

admin11's avatar
admin11
Icon for Memorable Member rankMemorable Member
4 years ago

SALES_ after replace as SALES_M , it give error msg

Hi All

 

Below expression working for last 3 year :-

 

SALES_YOY =
var _max = format(today(),"MMDD")
return
calculate(Sum('SALES'[SALES_]),DATESYTD('DATE'[Date]),format('DATE'[Date],"MMDD")<=_max)

Today i need to change the SALES_ to SALES_M , after i append the 2 table :-
 
SALES_YOY =
var _max = format(today(),"MMDD")
return
calculate(Sum('SALES'[SALES_M]),DATESYTD('DATE'[Date]),format('DATE'[Date],"MMDD")<=_max)
 
I get the below error msg :-
 

Column 'SALES_M' in table 'SALES' cannot be found or may not be used in this expression.

 

The fact is SALES_M is there. see below image :-

 

Paul

 

2 Replies

  • admin11 , SalesM is measure

     

    Try

     

    SALES_YOY =
    var _max = format(today(),"MMDD")
    return
    calculate(('SALES'[SALES_M]),DATESYTD('DATE'[Date]),format('DATE'[Date],"MMDD")<=_max)
     
    or
     
    SALES_YOY =
    var _max = format(today(),"MMDD")
    return
    calculate(Sumx('SALES',[SALES_M]),DATESYTD('DATE'[Date]),format('DATE'[Date],"MMDD")<=_max)
     
     
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi admin11,

    Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or accept the helpful suggestions to help others who faced similar requirements.

    If these also don't help, please share more detailed information to help us clarify your scenario to test.

    How to Get Your Question Answered Quickly 

    Regards,

    Xiaoxin Sheng