cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Transform Values in 1 Column into Multiple Columns in Visual

Hello - I have a "History" table with multiple statuses per unique ID by date. I would like to provide this data in a single row across a Table or Matrix visual so that for each unique ID I have only one row with the dates for each different status value. Currently all I have been able to accomplish is each status in a new column but the dates are all on a different row so the result is the same unique ID on four or five rows, one row for each status date in each proper column.

 

Is there a way I can model this data in the tables so that I can accomplish my goals for the visual?

Current Data Table Structure:

UniqueIDStatusIDStatusDTE
11018/12/1997
11024/10/2001
11035/14/2010
11043/12/2019
11055/14/2020
21026/19/2014
21049/9/2019
21053/20/2020
31015/15/2008
31031/12/2011
31047/23/2014
31059/12/2019
31026/26/2010
41015/7/2002
41028/29/2007
410312/29/2009

 

Visual with Modified Table Data Structure:

UniqueIDStatusID 1 0 1StatusID 1 0 2StatusID 1 0 3StatusID 1 0 4StatusID 1 0 5
18/12/19974/10/20015/14/20103/12/20195/14/2020
2 6/19/2014 9/9/20193/20/2020
35/15/20086/26/20101/12/20117/23/20149/12/2019
45/7/20028/29/200712/29/2009  
      
3 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Transform Values in 1 Column into Multiple Columns in Visual

All you need to do is load your data as in your example, and then create a matrix visual with your StatusID column as the Columns and ID Column as the Rows and put the Status Date field into the Values area (use the Earliest aggregation, or create your own measure).  You should get this result.

 

statusID.png

If you want the column headers to say "Status ID 101", etc. you can add a "Status ID " as a prefix to your StatusID column in the query editor.

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

View solution in original post

Highlighted
Super User IV
Super User IV

Re: Transform Values in 1 Column into Multiple Columns in Visual

@darrellmarkham , In a matrix, Take ID on Row, StatusID on Column and StatusDTE on Values with Aggregation as first or last



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Community Support
Community Support

Re: Transform Values in 1 Column into Multiple Columns in Visual

hi  @darrellmarkham 

You could get it by matrix visual as below:

https://docs.microsoft.com/en-us/power-bi/visuals/desktop-matrix-visual

Result:

2.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Highlighted
Community Champion
Community Champion

Re: Transform Values in 1 Column into Multiple Columns in Visual

All you need to do is load your data as in your example, and then create a matrix visual with your StatusID column as the Columns and ID Column as the Rows and put the Status Date field into the Values area (use the Earliest aggregation, or create your own measure).  You should get this result.

 

statusID.png

If you want the column headers to say "Status ID 101", etc. you can add a "Status ID " as a prefix to your StatusID column in the query editor.

 

If this works for you, please mark it as solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat

View solution in original post

Highlighted
Super User IV
Super User IV

Re: Transform Values in 1 Column into Multiple Columns in Visual

@darrellmarkham , In a matrix, Take ID on Row, StatusID on Column and StatusDTE on Values with Aggregation as first or last



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

View solution in original post

Highlighted
Community Support
Community Support

Re: Transform Values in 1 Column into Multiple Columns in Visual

hi  @darrellmarkham 

You could get it by matrix visual as below:

https://docs.microsoft.com/en-us/power-bi/visuals/desktop-matrix-visual

Result:

2.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: Transform Values in 1 Column into Multiple Columns in Visual

Thank You everyone. I started from the beginning to create the file and applied your suggestions and it worked right up to and including the Status Reasons ID added the the Status ID. Now if i can just figure out hopw to get that into Excel so I can merge it with other data.

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors