Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
My data is like below
id. Status. Status date
1. Active. 2/14/18
1. Approved 2/15/17
1. In review 2/19/18
1. Active. 3/15/19
my result
id active. Approved In review
1 2/14/18. 2/15/17. 2/19/18
1 3/15/19
@bharukc
You can achieve this in Power Query.
Create a blank Query, go to the Advanced Editor, clear the existing code, and paste the codes give below and follow the steps.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXJMLsksSwUyjPQNTfQNLZRidaASBQVF+WWpKRApU31Dc7hUUWpZZmo5RMISRQ/MMGOwDkul2FgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Status = _t, #"Status Date" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"ID", Int64.Type}, {"Status", type text}, {"Status Date", type date}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Status"}, {{"Count", each _, type table [ID=nullable number, Status=nullable text, Status Date=nullable date]}}),
#"Removed Columns" = Table.RemoveColumns(#"Grouped Rows",{"Status"}),
#"Added Custom" = Table.AddColumn(#"Removed Columns", "Custom", each Table.AddIndexColumn( [Count],"Index",1)),
#"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Custom"}),
#"Expanded Custom" = Table.ExpandTableColumn(#"Removed Other Columns", "Custom", {"ID", "Status", "Status Date", "Index"}, {"ID", "Status", "Status Date", "Index"}),
#"Removed Columns1" = Table.RemoveColumns(#"Expanded Custom",{"ID"}),
#"Pivoted Column" = Table.Pivot(#"Removed Columns1", List.Distinct(#"Removed Columns1"[Status]), "Status", "Status Date")
in
#"Pivoted Column"
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi @Fowmy
how about if I want each status to be a column.
if there are two dates for Active status, i want two status column so that I can show a id went to active status status after an inactive status.
Hi @bharukc
use a matrix visual. Place the id in rows and status inn columns and measure: SELECTEDVALUE ( TableName[Date] ) in values
I need to create pivoted table so that I can make gantt chart to show how many days does it take for each milestone.
You don't have to. You can calculate that without having you table pivotted. However, I have to say it might be easier to do the calculation while the table is pivoted.
User | Count |
---|---|
22 | |
11 | |
8 | |
6 | |
6 |
User | Count |
---|---|
25 | |
13 | |
11 | |
9 | |
6 |