Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi,
How can I add the "From" and "To" column for the hierarchy as shown in the image? Could you please help me with this?
I want to count the number of people who transferred from one location to another, grouped by region and location.
thanks,
Solved! Go to Solution.
@Uldevi
You need to first UnPivot the lat two columns (From and To) then use a simple measure to Count the ROWS: file attached.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8sxLyUxU0lHySszTNTIBMooS87IySzKALJfUnIxMIO2UnlOkFKuDUOuWmqRrZIqiFqxGR8m3NDcpMRNFsW9ipa6RGYriXIgqHaXs/OzEkkQ05UUQd5RlFiVm4XNFcGqBrpE5kkrcbvBPLtE1tERSiuGCWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [country = _t, date = _t, name = _t, #"transferred from" = _t, #"transferred to" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"country", type text}, {"date", type date}, {"name", type text}, {"transferred from", type text}, {"transferred to", type text}}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"country", "date", "name"}, "FromTo", "Location")
in
#"Unpivoted Other Columns"
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@Uldevi
You need to first UnPivot the lat two columns (From and To) then use a simple measure to Count the ROWS: file attached.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45W8sxLyUxU0lHySszTNTIBMooS87IySzKALJfUnIxMIO2UnlOkFKuDUOuWmqRrZIqiFqxGR8m3NDcpMRNFsW9ipa6RGYriXIgqHaXs/OzEkkQ05UUQd5RlFiVm4XNFcGqBrpE5kkrcbvBPLtE1tERSiuGCWAA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [country = _t, date = _t, name = _t, #"transferred from" = _t, #"transferred to" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"country", type text}, {"date", type date}, {"name", type text}, {"transferred from", type text}, {"transferred to", type text}}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"country", "date", "name"}, "FromTo", "Location")
in
#"Unpivoted Other Columns"
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 98 | |
| 72 | |
| 50 | |
| 49 | |
| 42 |