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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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
mahoneypat
Employee
Employee

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





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

amitchandak
Super User
Super User

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

View solution in original post

v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

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
Anonymous
Not applicable

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.

v-lili6-msft
Community Support
Community Support

hi  @Anonymous 

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.
amitchandak
Super User
Super User

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

mahoneypat
Employee
Employee

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





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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