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
ScottWill
Regular Visitor

Create a Measure based on text in table

Hello 

I need help creating a measure based on data in a table. Please see example blow 

I have a table Named ModelMaster 

In the table I have fields MODELCODE      VEHTYPE

 

Table Name: ModelMaster

MODELCODE      VEHTYPE

ASD12                C

DSA12                T

AAA33                

 

I need to create a measure named VEH RC  Eligable based on the following logic

VEH RC Eligable = If VEHTYPE = "C" then "Tri" 

                               else  If VEHTYPE = "T" then "Bi" 

                                       else If VEHTYPE = "" then "UNK"

                                               end if   

                                       end if 

                                end if  

 

result 

MODELCODE      VEHTYPE  VEH RC Eligable 

ASD12                C                       TRI

DSA12                T                        BI

AAA33                                         UNK 

 

Please advise as to how best I might accomplish this using a measure. 

 

Thank You in advance for any assistance you can provide. 

 

PS Colors are only provide as highlight, colors are not needed as part of the visual ouput 

 

1 ACCEPTED SOLUTION
ScottWill
Regular Visitor

I believe I figured it out 

VEH RC ELIGABLE = SWITCH (
SELECTEDVALUE ( ModelMaster[VEHICLETYPE]),
"C", "Tri",
"T", "Bi",
"", "UNK"
)

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @ScottWill ,

You can mark your own answers as correct so that more people can be helped.

 

Best Regards

Lucien

ScottWill
Regular Visitor

I believe I figured it out 

VEH RC ELIGABLE = SWITCH (
SELECTEDVALUE ( ModelMaster[VEHICLETYPE]),
"C", "Tri",
"T", "Bi",
"", "UNK"
)

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