Forum Discussion

FCF's avatar
FCF
Icon for Helper IV rankHelper IV
6 years ago
Solved

error message not sure what to do

 

i have this message when  trying to get a value from a column

  • Hi, FCF 

     

    You may try the following calculated column or measure.

    Calculated column:

    Column = 
    Targets[ Target Margin(CDN$) ]-
    CALCULATE(
        SUM(Sales[act_mar]),
        FILTER(
            ALL(Sales),
            [Week]=EARLIER(Targets[Wk #])
        )
    )

     

    Measure:

    Measure = 
    SELECTEDVALUE(Targets[ Target Margin(CDN$) ])-
    CALCULATE(
        SUM(Sales[act_mar]),
        FILTER(
            ALL(Sales),
            [Week]=SELECTEDVALUE(Targets[Wk #])
        )
    )

     

    Best Regards

    Allan

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

12 Replies

  • lkalawski's avatar
    lkalawski
    Icon for Resident Rockstar rankResident Rockstar

    FCF

    If you are creating a measure, you cannot refer to a column this way. The measure returns a single value, so you must use one of the aggregate functions (SUM, MIX, MAX etc.).

    If you want to compute something at row level then add a calculated column - then you can do it just like you do now.



    _______________
    If I helped, please accept the solution and give kudos! 😀

    • FCF's avatar
      FCF
      Icon for Helper IV rankHelper IV

      hi

      thanks for the response, i am really new to this and am not sure what you mean by creating a calculated column