Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (11.1k points)

I am having a table

Col1 Col2

11_A    9
12_B    8
13_C    7
14_A    6
15_A    4

The table i need after conversion

Col1  Col2  Col3

11_A    0   9
12_B    8   0
13_C    7   0
14_A    0   6 
15_A    0   4 

I have used the following query

Col3 = 
LEFT( 'Table'[Col2], 
     SEARCH("A", 'Table'[Col1], 0, 
         LEN('Table'[Col1])
     ) 

) 

How can I do this? 

1 Answer

0 votes
by (22.5k points)
edited by

Use the following steps:

  •  Select Power Query Editor in Power Bi desktop
  • On the edge of the screen select table
  •  Click on Add Column tab
  • and slect Conditional Column
  • Give a name to the column
  • Give the condition as present in the picture
  • And format the column.

For more information on Power BI, check the following Power BI Course

Also, check out our YouTube video to know the data visualization basics and best practices with Power BI

 

Related questions

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...