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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Duplicating a column and labeling its value

 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

 

Hi @Anonymous  You might want to try switch statement

Column = SWITCH(TRUE()
                ,'Table'[Age Mth to Mth]="Yr 1","New Car"
                ,'Table'[Age Mth to Mth]="Yr 2","In Warr"
                ,'Table'[Age Mth to Mth]="Yr 3","In Warr"
                ,'Table'[Age Mth to Mth]="Yr 4","Out Warr"
                ,'Table'[Age Mth to Mth]="Yr 5","Out Warr"
                ,'Table'[Age Mth to Mth]="Yr 6","Aged Car"
                ,'Table'[Age Mth to Mth]="Yr 7","Aged Car"
                ,'Table'[Age Mth to Mth]="Yr 8","Aged Car"
                ,'Table'[Age Mth to Mth]="Yr 9","Fence Sitter"
                ,'Table'[Age Mth to Mth]="Yr 10","Fence Sitter","Fence Sitter")

 

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Create the second table and in the Query Editor, use the Merge Table feature to bring over the required column to your existing table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

I think your column [Age Mth to Mth] should be a calculated column, so you cannot find it in power query. 

We can take a look at the article below: Calculated columns in Power BI Desktop, which explains the main difference between those two columns.

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

 

Hi @Anonymous  You might want to try switch statement

Column = SWITCH(TRUE()
                ,'Table'[Age Mth to Mth]="Yr 1","New Car"
                ,'Table'[Age Mth to Mth]="Yr 2","In Warr"
                ,'Table'[Age Mth to Mth]="Yr 3","In Warr"
                ,'Table'[Age Mth to Mth]="Yr 4","Out Warr"
                ,'Table'[Age Mth to Mth]="Yr 5","Out Warr"
                ,'Table'[Age Mth to Mth]="Yr 6","Aged Car"
                ,'Table'[Age Mth to Mth]="Yr 7","Aged Car"
                ,'Table'[Age Mth to Mth]="Yr 8","Aged Car"
                ,'Table'[Age Mth to Mth]="Yr 9","Fence Sitter"
                ,'Table'[Age Mth to Mth]="Yr 10","Fence Sitter","Fence Sitter")

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.