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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
juli__sia123412
Frequent Visitor

First product bought - cohort

HI,

 

I have the next table:

Customer Id - rank* - Order Id - SKU

   1234         -   1     - 7894        - SKU 1

   1234         -   2     - 7856        - SKU 2

   1456         -   1     - 7676        - SKU 1

   1456         -   2     - 7906        - SKU 3

   1789         -   1     - 7236        - SKU 5

   1906         -   1     - 7576        - SKU 2

* rank is based on purchase date. 

 

I want to have a column that will show the first SKU that this customer bought. Like:

Customer Id - rank - Order Id - SKU          -  FIRST SKU 

   1234         -   1    - 7894        - SKU 1       - SKU 1  

   1234         -   2    - 7856        - SKU 2       - SKU 1  

   1456         -   1    - 7676        - SKU 5       - SKU 5  

   1456         -   1    - 7676        - SKU 2       - SKU 5  

   1456         -   2    - 7906        - SKU 3       - SKU 5  

   1789         -   1    - 7236        - SKU 5       - SKU 5  

   1906         -   1    - 7576        - SKU 2       - SKU 2  

In case if one order (like 7676) have few SKU, any SKU can be choose.

 

Thanks!!

1 ACCEPTED SOLUTION
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @juli__sia123412 ,

You could try the calculated column below.

Column =
CALCULATE (
    MAX ( 'Table1'[SKU] ),
    FILTER (
        'Table1',
        'Table1'[Rank] = MIN ( 'Table1'[Rank] )
            && 'Table1'[Customer ID] = EARLIER ( Table1[Customer ID] )
    )
)

Here is the output.

Capture.PNG

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
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

1 REPLY 1
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @juli__sia123412 ,

You could try the calculated column below.

Column =
CALCULATE (
    MAX ( 'Table1'[SKU] ),
    FILTER (
        'Table1',
        'Table1'[Rank] = MIN ( 'Table1'[Rank] )
            && 'Table1'[Customer ID] = EARLIER ( Table1[Customer ID] )
    )
)

Here is the output.

Capture.PNG

Best  Regards,

Cherry

 

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.