Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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!!
Solved! Go to Solution.
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.
Best Regards,
Cherry
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.
Best Regards,
Cherry
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |