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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
melvin9900
Frequent Visitor

String Column not showing up in a switch Statement

Helllo , I am new to Power BI world.

Report Source : Tabular Model

Sample Table :  Details_table

melvin9900_0-1657120591047.png

 

4 Measures are created in the same table to do some calculation based on business conditions using the [Value] column for each Metrics.  

Measure_Revenue - Return the calculated value in $ .

Measure_Debt - Return the calculated value in $

Measure_Margin - Return the calculated value in %

Measure_Sales - Return the calculated value in whole number.

 

I have to create a report which shows the details like below.

melvin9900_0-1657122357932.png

 

 

I tried to create a matrix with row as a Employee and Column as Metrics. But for values I have calculated Measure values for each Metrics so I cannot use all 4 measures under the Values. I thought of creating a new measure using switch Statement to assign the calcaulated measure value to it based on the Metrics . So I  can use the new measure (Final_calculated_Measure) for values in the Matrix . Something like below.

 

Final_calculated_Measure = Switch( Details_table'[Metrics],"Revenue",Measure_Revenue ,

                                                          ,"Debt",Measure_Debt ,

                                                          ,"Margin",Measure_Margin ,

                                                          ,"Revenue",Measure_Revenue , 0)

 

This expression throwing error on Details_table'[Metrics]. I am not able to pick that column in the expression and getting a error cannont find the name. The pick list inside the switch statement shows only integer columns from the table.

Can someone please guide me how to implement this.

 

1 REPLY 1
tamerj1
Super User
Super User

@melvin9900 

You may try wrapping Details_table'[Metrics] with SELECTEDVALUE 

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

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!

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.

Users online (25)