Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi Everyone,
Having some problems where I have row level data with duplicates values that I need to find a minimum value for. In the below screenshot i would like to see a 3rd column that shows the minimum date difference for each "Ctr & Visit Code" value.
Is there a calculation in Power Query that i can use
Solved! Go to Solution.
Try below code in your advance editor/powerquery, it should work.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjRQ0lEyVIrVATKN4ExLOMsCIQ1SaQRhGsKZxghREygzFgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Date Difference" = _t, #"Ctr & Visit Code" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date Difference", Int64.Type}, {"Ctr & Visit Code", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Ctr & Visit Code"}, {{"Count", each _, type table [Date Difference=nullable number, #"Ctr & Visit Code"=nullable number]}}),
#"Added Custom1" = Table.AddColumn(#"Grouped Rows", "Custom.1", each List.First(List.Sort(Table.Column([Count],"Date Difference")))),
#"Expanded Count" = Table.ExpandTableColumn(#"Added Custom1", "Count", {"Date Difference"}, {"Count.Date Difference"})
in
#"Expanded Count"
Let me know if above makes sense
Hi @hazaboy9 ,
Try to use "Group" by the "Ctr & Visit Code" column and return a column of min value of "Date Difference" column.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @hazaboy9 ,
Try to use "Group" by the "Ctr & Visit Code" column and return a column of min value of "Date Difference" column.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Try below code in your advance editor/powerquery, it should work.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjRQ0lEyVIrVATKN4ExLOMsCIQ1SaQRhGsKZxghREygzFgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Date Difference" = _t, #"Ctr & Visit Code" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Date Difference", Int64.Type}, {"Ctr & Visit Code", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Ctr & Visit Code"}, {{"Count", each _, type table [Date Difference=nullable number, #"Ctr & Visit Code"=nullable number]}}),
#"Added Custom1" = Table.AddColumn(#"Grouped Rows", "Custom.1", each List.First(List.Sort(Table.Column([Count],"Date Difference")))),
#"Expanded Count" = Table.ExpandTableColumn(#"Added Custom1", "Count", {"Date Difference"}, {"Count.Date Difference"})
in
#"Expanded Count"
Let me know if above makes sense
refer if these can help
https://www.youtube.com/watch?v=rqDdnNxSgHQ
https://www.youtube.com/watch?v=qUmTxQHr6nY
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |