Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ian11001
Frequent Visitor

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", VALUES('asset_inventory asset'[Alt Department]), VALUES('bhr_collection employee'[department])
 
Thank you in advance!

 

2 ACCEPTED SOLUTIONS
MahyarTF
Memorable Member
Memorable Member

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

View solution in original post

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 :

MahyarTF_0-1662017385640.png

 

Mahyartf

View solution in original post

8 REPLIES 8
ian11001
Frequent Visitor

Thank you @MahyarTF 

 

IT worked now the syntax but it didnt show the result I was expecting.

Basically I want to combine the value of  ('asset_inventory asset'[Alt Department]) and ('bhr_collection employee'[department]) in to one column,  in the ('asset_inventory asset'[Alt Department]) there are null values that I want to replace it with the value in the ('bhr_collection employee'[department]).

 

Hi,

Would you please share sample data here ?

Mahyartf

Hi @MahyarTF ,

 

I have two tables, table1 and table2  some of the details on the Alt Department column has no data, that's why I want to create a new column based from the combination of  Alt Department from Table1 and Department from Table2 to produce the column of All Department. Already stablished the relationship of the two tables, only the combining of two columns I'm trying to solve.

ian11001_0-1662006185717.png

Please let me know if this is possible, thank you!

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 :

MahyarTF_0-1662017385640.png

 

Mahyartf

Thank you so much, it worked! 🙂

HoangHugo
Solution Specialist
Solution Specialist

Hi,

I don't know what is your purpose with dax. the function VALUES return a table with unique value column.

Hi @HoangHugo

Sorry forgot to state my goal

 

Basically I want to combine the value of  ('asset_inventory asset'[Alt Department]) and ('bhr_collection employee'[department]) in to one column,  in the ('asset_inventory asset'[Alt Department]) there are null values that I want to replace it with the value in the ('bhr_collection employee'[department]).


Not sure how to do it really

MahyarTF
Memorable Member
Memorable Member

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

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors