none
DAX Functions not Resolved RRS feed

  • Question

  • Hi,

    I'm using a business implementation of Microsoft Excel and constructing DAX queries. However I'm recieiving errors for certain formulas and operators even though I know they're being used correctly. Below is one such example, none of the trigonometric functions and the IN operator are being resolved in this implementation.

    "=
    VAR Lat1 = Module[Latitude]
    VAR Lng1 = Module[Longitude]
    VAR P =
        DIVIDE ( PI (), 180 )
    RETURN
        CALCULATE (
            FIRSTNONBLANK ( Venue[City], 0 ),
            // Arbitrary tie-break
            TOPN (
                1,
                Venue,
                VAR Lat2 = Venue[PostCodeAreas.Latitude]
                VAR Lng2 = Venue[PostCodeAreas.Longitude]
                //---- Algorithm here -----
                VAR A =
                    0.5 - COS ( ( Lat2 - Lat1 ) * P ) / 2
                        + COS ( Lat1 * P ) * COS ( lat2 * P ) * ( 1 - COS ( ( Lng2 - Lng1 ) * P ) ) / 2
                VAR final =
                    12742 * ASIN ( ( SQRT ( A ) ) )
                RETURN
                    final,
                ASC
            )
        )"

    This returns the error:

    "Failed to resolve name 'COS'. It is not a valid table, variable, or function name."

    Can someone please help?

    Tom


    Monday, September 17, 2018 8:03 AM

Answers

All replies