Forum Discussion
Funnels in Power BI
- 8 years ago
Hi Drors,
First, unpivot source table in Query Editor mode. And rename columns.
In data view, add calculated columns in data table.
Rank = RANKX ( FILTER ( Dataset1, Dataset1[User] = EARLIER ( Dataset1[User] ) ), Dataset1[Date], , ASC, DENSE ) Action Order = RIGHT ( CALCULATE ( LASTNONBLANK ( Dataset1[Action Type], 1 ), FILTER ( ALLEXCEPT ( Dataset1, Dataset1[User] ), [Rank] = 1 ) ), 1 ) & "-" & RIGHT ( CALCULATE ( LASTNONBLANK ( Dataset1[Action Type], 1 ), FILTER ( ALLEXCEPT ( Dataset1, Dataset1[User] ), [Rank] = 2 ) ), 1 ) & "-" & RIGHT ( CALCULATE ( LASTNONBLANK ( Dataset1[Action Type], 1 ), FILTER ( ALLEXCEPT ( Dataset1, Dataset1[User] ), [Rank] = 3 ) ), 1 ) & "-" & RIGHT ( CALCULATE ( LASTNONBLANK ( Dataset1[Action Type], 1 ), FILTER ( ALLEXCEPT ( Dataset1, Dataset1[User] ), [Rank] = 4 ) ), 1 )New a calculated table.
Table_1 = ADDCOLUMNS ( FILTER ( CROSSJOIN ( CROSSJOIN ( CROSSJOIN ( VALUES ( Dataset1[Action Type] ), SELECTCOLUMNS ( VALUES ( Dataset1[Action Type] ), "ActionType2", [Action Type] ) ), SELECTCOLUMNS ( VALUES ( Dataset1[Action Type] ), "ActionType3", [Action Type] ) ), SELECTCOLUMNS ( VALUES ( Dataset1[Action Type] ), "ActionType4", [Action Type] ) ), [Action Type] <> [ActionType2] && [Action Type] <> [ActionType3] && [Action Type] <> [ActionType4] && [ActionType2] <> [ActionType3] && [ActionType2] <> [ActionType4] && [ActionType3] <> [ActionType4] ), "Action Order", RIGHT ( [Action Type], 1 ) & "-" & RIGHT ( [ActionType2], 1 ) & "-" & RIGHT ( [ActionType3], 1 ) & "-" & RIGHT ( [ActionType4], 1 ) )Establish a one to many relationship between above two tables.
Place 'Table_1'[Action Order] and 'Dataset1'[User] into Funnel chart.
Best regards,
Yuliana Gu
Hi Drors,
First, unpivot source table in Query Editor mode. And rename columns.
In data view, add calculated columns in data table.
Rank =
RANKX (
FILTER ( Dataset1, Dataset1[User] = EARLIER ( Dataset1[User] ) ),
Dataset1[Date],
,
ASC,
DENSE
)
Action Order =
RIGHT (
CALCULATE (
LASTNONBLANK ( Dataset1[Action Type], 1 ),
FILTER ( ALLEXCEPT ( Dataset1, Dataset1[User] ), [Rank] = 1 )
),
1
)
& "-"
& RIGHT (
CALCULATE (
LASTNONBLANK ( Dataset1[Action Type], 1 ),
FILTER ( ALLEXCEPT ( Dataset1, Dataset1[User] ), [Rank] = 2 )
),
1
)
& "-"
& RIGHT (
CALCULATE (
LASTNONBLANK ( Dataset1[Action Type], 1 ),
FILTER ( ALLEXCEPT ( Dataset1, Dataset1[User] ), [Rank] = 3 )
),
1
)
& "-"
& RIGHT (
CALCULATE (
LASTNONBLANK ( Dataset1[Action Type], 1 ),
FILTER ( ALLEXCEPT ( Dataset1, Dataset1[User] ), [Rank] = 4 )
),
1
)
New a calculated table.
Table_1 =
ADDCOLUMNS (
FILTER (
CROSSJOIN (
CROSSJOIN (
CROSSJOIN (
VALUES ( Dataset1[Action Type] ),
SELECTCOLUMNS ( VALUES ( Dataset1[Action Type] ), "ActionType2", [Action Type] )
),
SELECTCOLUMNS ( VALUES ( Dataset1[Action Type] ), "ActionType3", [Action Type] )
),
SELECTCOLUMNS ( VALUES ( Dataset1[Action Type] ), "ActionType4", [Action Type] )
),
[Action Type] <> [ActionType2]
&& [Action Type] <> [ActionType3]
&& [Action Type] <> [ActionType4]
&& [ActionType2] <> [ActionType3]
&& [ActionType2] <> [ActionType4]
&& [ActionType3] <> [ActionType4]
),
"Action Order", RIGHT ( [Action Type], 1 ) & "-"
& RIGHT ( [ActionType2], 1 )
& "-"
& RIGHT ( [ActionType3], 1 )
& "-"
& RIGHT ( [ActionType4], 1 )
)
Establish a one to many relationship between above two tables.
Place 'Table_1'[Action Order] and 'Dataset1'[User] into Funnel chart.
Best regards,
Yuliana Gu
Wow its looks amaizing, thank you.
I have another question about that, If some of my clients just made 3 actions out of 4, for example
A>B>C (didnt do D)
and I want to see the discrepencies ( in order to know which action is more complicate and the users dont want to do it)
what do you recommend me to do?
- v-yulgu-msft8 years agoMicrosoft Employee
Hi Drors,
It looks like this is a new requirement different from the original post, right? If so, I would suggest you create a new thread on forum so that more community members can see it and provide advice. Please remember to post dummy data and desired result.
By the way, if my above advice is helpful to your scenario, would you please kindly mark it as an answer?
Thanks,
Yuliana Gu