Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
SammyNed
Helper I
Helper I

Product Pathways

Good Morning Team,

 

Can someone please assist me?, I am looking for a way to show the pathways my customers are using to get a product.

Below Table 1 is a example of my data type, a list of customer ID's, date of order and product bought. 

 

Table 1:

CstDateProduct
A2022/01/01Kettle
A2022/01/02Hairdryer
B2022/01/01Kettle
C2022/01/02Toaster
A2022/01/03Kettle
D2022/01/04Toaster
C2022/01/04Kettle
B2022/01/05Hairdryer
D2022/01/05Kettle

 

Solution example:

I want to show the pathways my customers used to buy their lastest kettle. So looking only at their last kettle bought, 

 

Pathways to KettleCst C & D bought a totaster before their last kettle2toaster -> kettle
  Cst A bought a hairdryer before their last kettle1hairdryer -> kettle
 Cst B bought a kettle first1kettle first

 

Is something like this possible in Powerbi?

 

Thank you in advance

Sam

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @SammyNed ,

I have created a simple sample, please refer to it to see if it helps you.

Create a column.

rankx = RANKX(FILTER('Table','Table'[Cst]=EARLIER('Table'[Cst])),'Table'[Date],,ASC,Dense)

Then create a measure.

Kettle =
VAR _1 =
    CONTAINSSTRINGEXACT (
        CONCATENATEX ( ALLSELECTED ( 'Table' ), 'Table'[Product], "" ),
        "Kettle"
    )
        = TRUE ()
VAR _1first =
    CALCULATE (
        MAX ( 'Table'[Product] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Cst] = SELECTEDVALUE ( 'Table'[Cst] )
                && 'Table'[rankx] = 1
        )
    )
VAR _2first =
    CALCULATE (
        MAX ( 'Table'[Product] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Cst] = SELECTEDVALUE ( 'Table'[Cst] )
                && 'Table'[rankx] = 2
        )
    )
VAR _3first =
    CALCULATE (
        MAX ( 'Table'[Product] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Cst] = SELECTEDVALUE ( 'Table'[Cst] )
                && 'Table'[rankx] = 3
        )
    )
RETURN
    _1first & "   " & _2first & "   " & _3first

vpollymsft_0-1658974392396.png

If I have misunderstood your meaning, please provide more details with your desired output.

 

Best Regards
Community Support Team _ Polly

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @SammyNed ,

I have created a simple sample, please refer to it to see if it helps you.

Create a column.

rankx = RANKX(FILTER('Table','Table'[Cst]=EARLIER('Table'[Cst])),'Table'[Date],,ASC,Dense)

Then create a measure.

Kettle =
VAR _1 =
    CONTAINSSTRINGEXACT (
        CONCATENATEX ( ALLSELECTED ( 'Table' ), 'Table'[Product], "" ),
        "Kettle"
    )
        = TRUE ()
VAR _1first =
    CALCULATE (
        MAX ( 'Table'[Product] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Cst] = SELECTEDVALUE ( 'Table'[Cst] )
                && 'Table'[rankx] = 1
        )
    )
VAR _2first =
    CALCULATE (
        MAX ( 'Table'[Product] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Cst] = SELECTEDVALUE ( 'Table'[Cst] )
                && 'Table'[rankx] = 2
        )
    )
VAR _3first =
    CALCULATE (
        MAX ( 'Table'[Product] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Cst] = SELECTEDVALUE ( 'Table'[Cst] )
                && 'Table'[rankx] = 3
        )
    )
RETURN
    _1first & "   " & _2first & "   " & _3first

vpollymsft_0-1658974392396.png

If I have misunderstood your meaning, please provide more details with your desired output.

 

Best Regards
Community Support Team _ Polly

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

tamerj1
Super User
Super User

Hi @SammyNed 

how many products do you have? What if two or more products are bought before the kettle?

Hi @tamerj1 

 

There are 5 products in total, however over 40k customers. I basically want to find some sort of corelation between the last product the customer bought and what they bought before that. So do more customers buy toasters and then kettles or do more customers buy haridryers first when they come on site for example.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.