Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Good Day.
I am looking for a DAX formula that can display the first product ordered in a new column, based on the Group ID (expected results in Red😞
Group ID | Date/Time of order | Product | Expected Result |
342582 | 15/11/2024 08:00 | Crisps | Crisps |
342582 | 15/11/2024 08:01 | Sweets | Crisps |
342582 | 15/11/2024 08:08 | Soft Drink | Crisps |
342582 | 15/11/2024 08:15 | Teabags | Crisps |
342583 | 15/11/2024 08:02 | Teabags | Teabags |
342583 | 15/11/2024 08:10 | Sweets | Teabags |
342583 | 15/11/2024 08:11 | Soft Drink | Teabags |
342583 | 15/11/2024 08:07 | Crisps | Teabags |
342584 | 15/11/2024 08:22 | Crisps | Sweets |
342584 | 15/11/2024 08:21 | Sweets | Sweets |
342584 | 15/11/2024 08:26 | Soft Drink | Sweets |
342584 | 15/11/2024 08:35 | Teabags | Sweets |
342585 | 15/11/2024 08:48 | Crisps | Soft Drink |
342585 | 15/11/2024 08:45 | Sweets | Soft Drink |
342585 | 15/11/2024 08:42 | Soft Drink | Soft Drink |
342585 | 15/11/2024 08:50 | Teabags | Soft Drink |
Thanks in advance.
Solved! Go to Solution.
Try Belwo Measure:
First Product Ordered =
VAR FirstOrderTime =
CALCULATE(
MIN('Table'[Date/Time of order]),
ALLEXCEPT('Table', 'Table'[Group ID])
)
RETURN
CALCULATE(
FIRSTNONBLANK('Table'[Product], 1),
'Table'[Date/Time of order] = FirstOrderTime,
ALLEXCEPT('Table', 'Table'[Group ID])
)
Group ID Date/Time of order Product First Product Ordered
342582 | 15/11/2024 08:00 | Crisps | Crisps |
342582 | 15/11/2024 08:01 | Sweets | Crisps |
342582 | 15/11/2024 08:08 | Soft Drink | Crisps |
342582 | 15/11/2024 08:15 | Teabags | Crisps |
342583 | 15/11/2024 08:02 | Teabags | Teabags |
342583 | 15/11/2024 08:10 | Sweets | Teabags |
342583 | 15/11/2024 08:11 | Soft Drink | Teabags |
342583 | 15/11/2024 08:07 | Crisps | Teabags |
342584 | 15/11/2024 08:22 | Crisps | Sweets |
342584 | 15/11/2024 08:21 | Sweets | Sweets |
342584 | 15/11/2024 08:26 | Soft Drink | Sweets |
342584 | 15/11/2024 08:35 | Teabags | Sweets |
342585 | 15/11/2024 08:48 | Crisps | Soft Drink |
342585 | 15/11/2024 08:45 | Sweets | Soft Drink |
342585 | 15/11/2024 08:42 | Soft Drink | Soft Drink |
342585 | 15/11/2024 08:50 | Teabags | Soft Drink |
This will display the expected results as per your requirements. Let me know if you need further clarification!
Thanks for your help, that has done the trick!
U r always welocme
Try Belwo Measure:
First Product Ordered =
VAR FirstOrderTime =
CALCULATE(
MIN('Table'[Date/Time of order]),
ALLEXCEPT('Table', 'Table'[Group ID])
)
RETURN
CALCULATE(
FIRSTNONBLANK('Table'[Product], 1),
'Table'[Date/Time of order] = FirstOrderTime,
ALLEXCEPT('Table', 'Table'[Group ID])
)
Group ID Date/Time of order Product First Product Ordered
342582 | 15/11/2024 08:00 | Crisps | Crisps |
342582 | 15/11/2024 08:01 | Sweets | Crisps |
342582 | 15/11/2024 08:08 | Soft Drink | Crisps |
342582 | 15/11/2024 08:15 | Teabags | Crisps |
342583 | 15/11/2024 08:02 | Teabags | Teabags |
342583 | 15/11/2024 08:10 | Sweets | Teabags |
342583 | 15/11/2024 08:11 | Soft Drink | Teabags |
342583 | 15/11/2024 08:07 | Crisps | Teabags |
342584 | 15/11/2024 08:22 | Crisps | Sweets |
342584 | 15/11/2024 08:21 | Sweets | Sweets |
342584 | 15/11/2024 08:26 | Soft Drink | Sweets |
342584 | 15/11/2024 08:35 | Teabags | Sweets |
342585 | 15/11/2024 08:48 | Crisps | Soft Drink |
342585 | 15/11/2024 08:45 | Sweets | Soft Drink |
342585 | 15/11/2024 08:42 | Soft Drink | Soft Drink |
342585 | 15/11/2024 08:50 | Teabags | Soft Drink |
This will display the expected results as per your requirements. Let me know if you need further clarification!
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
15 | |
11 | |
10 | |
10 |