March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
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:
UniqueID | StatusID | StatusDTE |
1 | 101 | 8/12/1997 |
1 | 102 | 4/10/2001 |
1 | 103 | 5/14/2010 |
1 | 104 | 3/12/2019 |
1 | 105 | 5/14/2020 |
2 | 102 | 6/19/2014 |
2 | 104 | 9/9/2019 |
2 | 105 | 3/20/2020 |
3 | 101 | 5/15/2008 |
3 | 103 | 1/12/2011 |
3 | 104 | 7/23/2014 |
3 | 105 | 9/12/2019 |
3 | 102 | 6/26/2010 |
4 | 101 | 5/7/2002 |
4 | 102 | 8/29/2007 |
4 | 103 | 12/29/2009 |
Visual with Modified Table Data Structure:
UniqueID | StatusID 1 0 1 | StatusID 1 0 2 | StatusID 1 0 3 | StatusID 1 0 4 | StatusID 1 0 5 |
1 | 8/12/1997 | 4/10/2001 | 5/14/2010 | 3/12/2019 | 5/14/2020 |
2 | 6/19/2014 | 9/9/2019 | 3/20/2020 | ||
3 | 5/15/2008 | 6/26/2010 | 1/12/2011 | 7/23/2014 | 9/12/2019 |
4 | 5/7/2002 | 8/29/2007 | 12/29/2009 | ||
Solved! Go to Solution.
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.
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
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
@Anonymous , In a matrix, Take ID on Row, StatusID on Column and StatusDTE on Values with Aggregation as first or last
hi @Anonymous
You could get it by matrix visual as below:
https://docs.microsoft.com/en-us/power-bi/visuals/desktop-matrix-visual
Result:
Regards,
Lin
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.
hi @Anonymous
You could get it by matrix visual as below:
https://docs.microsoft.com/en-us/power-bi/visuals/desktop-matrix-visual
Result:
Regards,
Lin
@Anonymous , In a matrix, Take ID on Row, StatusID on Column and StatusDTE on Values with Aggregation as first or last
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.
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
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
86 | |
76 | |
57 | |
52 |
User | Count |
---|---|
201 | |
137 | |
108 | |
73 | |
68 |