Building a QC Dashboard Pt. 3
Photo by Ambitious Creative Co. - Rick Barrett

Building a QC Dashboard Pt. 3

Hello everyone! Are you ready for Part 3 of our QC Dashboard journey?

I know I am!

In Part 2 we used the Power Query Editor to delete some rows and columns to our query. In this article we will add a few more steps that focus on transforming the data.

Let's get started!

Part 3 - Transforming Data

Below I have the Power Query Editor open. *As a refresher, I got there by clicking Transform data on the Home tab.

My Building Details data has a column called Building Type. The data looks to be two different kinds of information separated by a "-". I would really like to create two new fields with the data from the left of the hyphen in one field and the data to the right of the hyphen in another.

If you are familiar with Excel, this can be done using the Text to columns function. Power BI has a similar function called Split Column.

Power BIs, Power Query Editor. Arrow pointing to the Building Type field.

With Building Type selected click Split Columns. Notice there are more options available then Excels Text to columns. Here, I will be using the By Delimiter option.

Zoomed in on Power BIs, Power Query Editors, Split columns function. It has been clicked and is displaying the different options.

Once selected, a pop-up window opens with a number of options. For my data, the delimiter will be the hyphen. Since hyphen is not one of the options, I will select --Custom--.

The Split Column by Delimiter pop-up window with the Custom delimiter option selected.

One of the coolest things about the custom option is, unlike Excel, we are not limited to one character. This means, if my delimiter was a string of characters, like " - ", a space hyphen space, I could use that as a delimiter. Yeah, very cool. :)

However, we are just using the hyphen.

My next option is the Split at. This gives us control as to where to split the data by. If there were multiple hyphens in my Building Type field, but I only wanted to split it by the Left-most delimiter and ignore the other hyphens, I would select that options. The same goes for the Right-most delimiter. The Each occurrence of the delimiter is just that. Every time Power Query finds a delimiter (a hyphen in our example), it would create a new field or column. So, if you had a phone number field with 1-203-123-4567, and used that option, you would have four new columns in your data set.

I normally do not need to use the Advanced options setting but you have the ability to spilt the data into Columns or Rows and be able to split by a given number of columns. I also do not use the Quote Character or Split using special characters option but it is available if you need it.

I am good with the below settings; so, I click OK.

Split column by delimiter pop-up window.

And now we have two new columns, Building Type.1 and Building Type.2. We can also see that two new steps were added, Split Columns by Delimiter and Change Type 1.

I can now change the name of the column headers of the two new columns, so that they make more sense.

Power BIs, Power Query Editor. Red arrows pointing to two new columns created from using the Split Columns by delimiter function. And a red arrow pointing to the two new steps.

I can double-click the column header to give it a better name. I will call the first one, Building Category and the second one Building Sub-Category. After doing so, another step, Renamed Columns is added to the list.

The column headers Building Type.1 is selected as to edit the column header name.

There is one more modification I would like to do and that is to concatenate, or join, the Address, City, State, and Zip code columns into one column and give it a name of Full Address.

Red arrows pointing to the Address, City, State, and Zip code columns.

To do this, I navigate to the Add Column tab and select the Custom Column function.

Power BIs, Power Query Editors Add Column tab selected and the Custom Column function is selected.

A pop-up window will open. Here we can give our Custom Column a name, using the New column name field. Then we can build our formula.

To do that, I found and double-clicked the columns I wanted to add from the Available columns section. I also added the "&" character between the columns. This is just like saying I am combining this column AND this column AND this column.

Notice that I also have some stuff inside double quotes. If I just combined Address and City, there would be no space and the result would look like 1 Hacker WayMenlo Park.

Not the result I am going for.

So, I separate Address and City with a comma and a space. The same between City and State. Then I separate State and Zip with just a space.

The Custom Column pop-up window showing a formula that will concatenate Address, City, State, and Zip code.

Below is the result.

Looking good to me!

Power BIs, Power Query Editors data preview window showing the newly created column, Full Address.

Our data is starting to shape up! In the next couple of articles we will look at the Floor and Space Details data sets and see if we need to make any transformation there.

Thanks for reading and if you have any questions,?do not hesitate?in adding a comment or messaging me. I am always willing to help! And if you liked what you read, share the love by sharing the post. :)

要查看或添加评论,请登录

Jay West的更多文章

  • Building a QC Dashboard Pt. 8

    Building a QC Dashboard Pt. 8

    Hello everyone! It is that time again! :) Time to continue on our Dashboard path with part 8 and start digging into the…

    2 条评论
  • Building a QC Dashboard Pt. 7

    Building a QC Dashboard Pt. 7

    Has it really been since July 19th since I last posted?! Ugh! Shame on me! Well, let's not dwell on things out of our…

  • Building a QC Dashboard Pt. 6

    Building a QC Dashboard Pt. 6

    Wow. Has it been a month since Building a QC Dashboard Pt.

  • Building a QC Dashboard Pt. 5

    Building a QC Dashboard Pt. 5

    Hello everyone! Are you ready for Part 5 of our QC Dashboard journey? I know I am! In Part 4 we wrapped up exploring…

  • Building a QC Dashboard Pt. 4

    Building a QC Dashboard Pt. 4

    Hello everyone! Are you ready for Part 4 of our QC Dashboard journey? I know I am! In Part 3 we used the Power Query…

  • Building a QC Dashboard Pt. 2

    Building a QC Dashboard Pt. 2

    Hello all! I hope everyone is having an amazing week! If you have been following along, last week we started building a…

  • Building a QC Dashboard Pt. 1

    Building a QC Dashboard Pt. 1

    Hello all! I hope everyone is having an amazing week! This week I would like to dig in a little deeper on how I create…

    2 条评论
  • Visuals

    Visuals

    Today I would like to talk about visualization data. But not just any visualization.

    7 条评论
  • Past articles

    Past articles

    Okay, so I am not sure how this newsletter works yet and instead of reposting my past articles, I am going to add links…

  • Questions

    Questions

    Hello readers! I hope everyone is having and amazing week so far. :) I am asked from time to time, What should I learn…

    5 条评论

社区洞察

其他会员也浏览了