Forum Discussion

Drors's avatar
Drors
Resolver III
8 years ago
Solved

Funnels in Power BI

Hi All,   Im not sure how to display that kind of information in power bi and if powerbi have relevent charts to that kind of information.   I have a data of users and 5 actions they can do in an...
  • v-yulgu-msft's avatar
    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