The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
28 | |
12 | |
8 | |
7 | |
5 |
User | Count |
---|---|
36 | |
14 | |
12 | |
7 | |
7 |