Forum Discussion

Redraidas1's avatar
Redraidas1
Helper I
5 years ago
Solved

Need help with DAX - Incorrect syntax

I have a very simple DAX snippet, however, for some reason Power BI throws an error saying: 'The syntax for ')' is incorrect.   I can't figure out what's wrong? count = CALCULATE (     DIS...
  • littlemojopuppy's avatar
    5 years ago

    The problem is with the SUMX statement.  Try this.

     

    count =
    CALCULATE (
    	DISTINCTCOUNT ( DimFranchiseMarket[FranchiseMarketName] ),
    	FILTER (
    		DimFranchiseMarket,
    		SUMX (
    			RELATEDTABLE ( GroupValuesOutput ),
    			GroupValuesOutput[GroupValue]
    		) <> BLANK
    	)
    )

     

     

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi Redraidas1 ,

    First, you can use DAX Formatter tool to format and validate your formula of measure. It will be more simple to find the problem. If it is OK after validate in the tool, then check the formula base on the actual requirement again. Anyway, littlemojopuppy has already provided you the correct formula...

    count =
    CALCULATE (
        DISTINCTCOUNT ( DimFranchiseMarket[FranchiseMarketName] ),
        FILTER (
            DimFranchiseMarket,
            SUMX ( RELATEDTABLE ( GroupValuesOutput ), GroupValuesOutput[GroupValue] ) <> BLANK
        )
    )

    Best Regards