Forum Discussion

Jeanxyz's avatar
Jeanxyz
Power Participant
4 years ago
Solved

need help with values() formula

I try to run values function over a filtered project table, but I get an error message with the values(). Could someone help?

 

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Jeanxyz ,

     

    I have built a data sample:

     

    The variable could not be the parameter for VALUES() 

     

    You may try to use DISTINCT() :

    Measure = 
    VAR _t= DISTINCT( FILTER('Table',[Column2]="A"))
    VAR _sumx=SUMX(_t,MAX('Table'[Column1]))
    return _sumx

     

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

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Jeanxyz ,

     

    I have built a data sample:

     

    The variable could not be the parameter for VALUES() 

     

    You may try to use DISTINCT() :

    Measure = 
    VAR _t= DISTINCT( FILTER('Table',[Column2]="A"))
    VAR _sumx=SUMX(_t,MAX('Table'[Column1]))
    return _sumx

     

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

  • Jeanxyz , In sumx values you need to give a column, you are giving a table

     

    example

    Sumx(Values(Table[Column]), [measure])

    • Jeanxyz's avatar
      Jeanxyz
      Power Participant

      I don't quite understand your comments, in sumx I am asking to get the max from column [workdays] in the row context provided by values and sum it up. 

       

      • rbriga's avatar
        rbriga
        Impactful Individual

        On your second line, you have an error with VALUES(filter_project).

        You must provide a column, not a table.

  • rbriga's avatar
    rbriga
    Impactful Individual

    VALUES() recieves a table here, when it expects a column. 

    For example, you can't run VALUES('Customers'), but you something like VALUES('Customers'[Country])