Forum Discussion

SkorpionAAM's avatar
SkorpionAAM
Icon for Helper V rankHelper V
5 years ago
Solved

Multiple arguments are not allowed in the ALLSELECTED function when the first argument is a table re

I M GEETING ERROR in this formula "Multiple arguments are not allowed in the ALLSELECTED function when the first argument is a table reference." any one tell me where im wrong 

SUMx('Calculation',[Requeird pop*0.45]) * ALLSELECTED('Operation Cost','Operation Cost'[Operation Cost])

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,SkorpionAAM 

     

    The syntax of ALLSELECTED is incorrect.

    The ALLSELECTED function returns the context of the query without any column and row filters.

    If there is one argument, the argument is either tableName or columnName.

    If there is more than one argument, they must be columns from the same table.

     

    But ALLSELECTED  maybe is not the best way to solve it, you can try like this to meet your needs,

     

    Measure =SUMX ( 'Calculation', [Requeird pop*0.45] ) * SELECTEDVALUE ( 'Operation Cost'[Operation Cost] )

     

    Or

     

    Measure =SUMX ( 'Calculation', [Requeird pop*0.45] ) * MAXX( 'Operation Cost'[Operation Cost] )

     

     

    If you want to learn more about it ,you can refer to : https://docs.microsoft.com/en-us/dax/allselected-function-dax

     

    Hope it helps.

     

    Best Regards,

    Caitlyn Yan

     

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