Forum Discussion
Anonymous
6 years agoNot applicable
Counting Abandoned Flows
Hello All, Thanks for looking in to my post. I am struggling to find a better solution for below problem. Data: mud_id visitor_id session_id Time stamp Page Name sk4844625 523012 2...
- 6 years ago
Hi, Anonymous
Based on my research, you may try the following measures.
totalflowforuser = COUNTROWS( FILTER( ALL('Table'), 'Table'[Page Name] = "Projects Page"&& 'Table'[mud_id] = MAX('Table'[mud_id]) ) ) completedflows = COUNTROWS( FILTER( ALL('Table'), 'Table'[Page Name] = "Hit Connect"&& 'Table'[mud_id] = MAX('Table'[mud_id]) ) ) abandonedflows = COUNTROWS( FILTER( ALL('Table'), 'Table'[Page Name] = "Select API environment"&& 'Table'[mud_id] = MAX('Table'[mud_id]) ) )-[completedflows] notflow = [totalflowforuser]-[completedflows]-[abandonedflows]Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
stretcharm
Memorable Member
6 years agoI used the group all rows to next the Pages, then used Table functions to filed it the Page has been visited Table.RowCount(Table.FindText([Events], "Projects Page"))
Note this just looks for the page rather than first and last pages. If you need that then the code would be a bit trickier
Data
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("vZjfb9owEMf/FStPrdSqubMvP3jr+jCmahLaHlseUprRrGlcgbu/fw4kaxsNOGMHIaETxJ9zcl++d/juLlo/q0ypBCm6iAhlDGgDjNuXDSC+QryCXEA8wVxcf7efTcu61hDNL1wWy3i7eLbSv8uFWYtZsSxdGbhl3NTV4lnoRlyLDicu+8h5X2rAvI9udNO0zMImmH0TZw/aGP0iVtXyybRXdJnOXTMl20wtc1GYotZL8XrEQ8i2mJ9l/WGTl5v3x9IUVb0+Bqu6+vQ3b/S/Z/vwZu+/ceXhp222uyubP9VKNy9lY1xhXZGmlRHdBl0Jib/8VBZefhSfSn6EQeRHahT5URJWfpQFlF8P2xgfOi2GSextfJYR3Pgs80TGZzMdZ3wwxIQxviEWghqf5aF/vWFYmwD1huRU9YYsgNPABOMRnMZiMWy9UR10mq+3EkFRYq9Sm6hFoFQDLb4PSdPy1X7vsxbw1+Nq6UiAXcrlIyRXuHwk+emWnyjdI1s+JXdQLZuqgCNaPk6G06yi/89mfEDqLTuVB5cdwYlkRzKE7IjGkB2lQWVH+UHZffkBaCHSXpWkZCMb5FmakGKbFR/BNis+0rPJ8hPt67FsinJpsXyq5KiGj6Nwqum9ZmhWbADtnOb5CPYwz0d6zvL8RPt6JJ/i0iOZVPv/gNUj+bjDcx2ftfP0gY9gHz6wkeDZ4viJ9rU4PsWlxfGpmXdpcHiG418aHHrEWKVBClEaTMcoTX/eHOgHLQ+cSM7/Ag==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [mud_id = _t, visitor_id = _t, session_id = _t, #"Time stamp" = _t, #"Page Name" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"mud_id", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"visitor_id", "session_id"}, {{"Events", each _, type table [mud_id=text, visitor_id=number, session_id=number, Time stamp=text, Page Name=text]}, {"Start Time stamp", each List.Min([Time stamp]), type text}}),
#"Added Custom" = Table.AddColumn(#"Grouped Rows", "Abandoned Flow", each if Table.RowCount(Table.FindText([Events], "Hit Connect"))=0 then "Y" else "N"),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "No flow at all", each if Table.RowCount(Table.FindText([Events], "Select API environment"))=0 then "Y" else "N"),
#"Added Custom2" = Table.AddColumn(#"Added Custom1", "Completed flow", each if Table.RowCount(Table.FindText([Events], "Projects Page"))<>0 and Table.RowCount(Table.FindText([Events], "Hit Connect"))<>0 then "Y" else "N")
in
#"Added Custom2"
Data Summary
let
Source = Data,
#"Unpivoted Columns" = Table.UnpivotOtherColumns(Source, {"visitor_id", "session_id", "Events", "Start Time stamp"}, "Attribute", "Value"),
#"Filtered Rows" = Table.SelectRows(#"Unpivoted Columns", each ([Value] = "Y")),
#"Grouped Rows" = Table.Group(#"Filtered Rows", {"Attribute"}, {{"Count", each Table.RowCount(_), type number}})
in
#"Grouped Rows"
- Anonymous6 years agoNot applicable
Thank you. this works great. But my original data is complex and editing at query level is became tough. Dax solution is preferred.
Thanks again for helping me.