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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
mahoneypat
Microsoft Employee
Microsoft 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.