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
Omega
Impactful Individual
Impactful Individual

if measure with attributes

Hi all,

 

I currently have a live connection data in PBI. I have the below column: 

 

Test  |

Test1|

Test2|

Test3|

 

I want to create a MEASURE that can change the values in the above column to: 

 

Hi

Hello

Create

Hey

 

respectively,

 

How?

 

I created a variable and used max (column1) and then applied switch function. When I drag the measure, it shows me only 1 row but I need the rest of the rows to appear. 

 

Please help. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Omega,

Create the following measure and check if it returns your expected result.

Measure = SWITCH(FIRSTNONBLANK(Table[Column],1),"Test","Hi","Test1","Hello","Test2","Create","Test3","Hey")

1.JPG

Regards,
Lydia

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

@Omega,

Create the following measure and check if it returns your expected result.

Measure = SWITCH(FIRSTNONBLANK(Table[Column],1),"Test","Hi","Test1","Hello","Test2","Create","Test3","Hey")

1.JPG

Regards,
Lydia

Yggdrasill
Responsive Resident
Responsive Resident

This is not a measure but should do the same.

 

  1. Go in to Query Editor and
  2. select the column you're referring to.
  3. Go to Transform -> Replace values - > Test| replaced with Hi etc.

 

This works in DirectQuery for me and the Switch function works with calculated column as well even in DirectQuery mode.

 

Do you have a check mark in File - > Options - > DirectQuery - > "Allow unrestricted measures in DirectQuery mode" ? 

dramus
Continued Contributor
Continued Contributor

If each new value is based on that row's column value, try creating a new column, rather than a new measure.

Omega
Impactful Individual
Impactful Individual

We can't create new columns in Power BI when there is a live connection. 😞

dramus
Continued Contributor
Continued Contributor

Can you do the transformation in the Power Query?

 

If not then it will depend on your model as to the best way to do this? Do you have a lookup table for the changes, or is it a limited number of values?

Omega
Impactful Individual
Impactful Individual

Unfortunately we can't move to PQuery 😞

 

The challenge is to create a measure that changes certain text to another. 😄

dramus
Continued Contributor
Continued Contributor

So how are you getting the data into Power BI now?

Omega
Impactful Individual
Impactful Individual

Analysis Services (Azure)

dramus
Continued Contributor
Continued Contributor

You can add simple columns to tables in Direct Query. I haven't tried it with AAS, but I can do it for other SQL sources. 

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