Forum Discussion

ian11001's avatar
ian11001
Frequent Visitor
4 years ago
Solved

Operator or expression '()' is not supported in this context

Hi Team, Good day!   I'm currently having this error with my measure not sure what is the proper syntax. 😞   Department All = If (VALUES('asset_inventory asset'[Alt Department]) <> "null", VAL...
  • MahyarTF's avatar
    4 years ago

    Hi,

    You need the ')' at the end of your code. 

    It is not closed properly. If you did, use the below code instead :

    Department All = If (SELECTEDVALUE('asset_inventory asset'[Alt Department]) <> "",
                         SELECTEDVALUE('asset_inventory asset'[Alt Department]),
                         SELECTEDVALUE('asset_inventory asset'[Alt Department])
                        )
    Appreciate your Kudos
  • MahyarTF's avatar
    MahyarTF
    4 years ago

    Hi,

    I have another suggestion :

    1- in Power Query, Merge these tables based on the 'Name', and bring the names and Alt Department from Table1 and Department from Table2

    2- Add a custom column and use below M query :

    if [Alt Department] <> "" and Text.Upper([Alt Department]) <> Text.Upper("null")
    then [Alt Department]
    else [Sheet143.department]

    3- then use the created column in your visual :