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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Shreesefwere
Helper IV
Helper IV

swith statement

HI Expert,

unable to use switch statement in 2 table in ssas cube

i have used the switch statement but it is not taking columns from more than one table

I created calculated colmun 

=SWITCH(('Table1'[col1]="Opportunity Owner"),'Table1[col2],'Table2'[col1])

4 REPLIES 4
Anonymous
Not applicable

actually table1- dept ,empid

table2 deptid,deptname  

table3 emp id,empname

 switch statement used in 

table1--->table3

table2--->table3

 

so using switch(table2,deptname=Central, table3.empaname)

else condition used lookupvalue and tried lookupvalue(table1.col2,table2.col1,table1.col1) so when join in central fact table then lookupvalue not working

 

empname is value not coming

Shreesefwere
Helper IV
Helper IV

suggestion please

Kishore_KVN
Super User
Super User

Hello @Shreesefwere ,

Instead of providing just Table2[Col1] use LOOKUPVALUE function there and it will bring data from other table. Switch function dont have that ability to pull from different tables.

 

If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!

Hi Expert,

actually table1- dept ,empid

table2 deptid,deptname  

table3 emp id,empname

 switch statement used in 

table1--->table3

table1--->table2

 

so using switch(table2,deptname=Central, table3.empaname)

empname is value not coming

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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