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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Trying to create a new column based on multiple sorted rows within the same OrderNumber.
I have the following schema:
| Description | OrderNumber | OrderRow |
| Art 1 | 30000 | 10 |
| Art 2 | 30000 | 20 |
| Art 3 | 30000 | 30 |
| Art 4 | 30001 | 10 |
| Art 5 | 30001 | 20 |
| Art 6 | 30001 | 30 |
I want to make a new column with the Description of the rows with the lowest OrderRow value within the same OrderNumber.
Which would be:
| Description | OrderNumber | OrderdRow | New Column |
| Art 1 | 30000 | 10 | Art 1 |
| Art 2 | 30000 | 20 | Art 1 |
| Art 3 | 30000 | 30 | Art 1 |
| Art 4 | 30001 | 10 | Art 4 |
| Art 5 | 30001 | 20 | Art 4 |
| Art 6 | 30001 | 30 | Art 4 |
I have no idea where to begin, probably due lack of DAX-syntax knowledge. Or maybe this is easier in the query editor.
Solved! Go to Solution.
Hi @MrMarshall,
You could create a calculated column with dax expression below.
New Column =
CALCULATE (
MAX ( 'Order'[Description] ),
FILTER (
'Order',
'Order'[OrderNumber] = EARLIER ( 'Order'[OrderNumber] )
&& 'Order'[OrderRow] = MIN ( 'Order'[OrderRow] )
)
)
Then you will get your expected output.
Hope this can help you!![]()
Best Regards,
Cherry
Hi @MrMarshall,
You could create a calculated column with dax expression below.
New Column =
CALCULATE (
MAX ( 'Order'[Description] ),
FILTER (
'Order',
'Order'[OrderNumber] = EARLIER ( 'Order'[OrderNumber] )
&& 'Order'[OrderRow] = MIN ( 'Order'[OrderRow] )
)
)
Then you will get your expected output.
Hope this can help you!![]()
Best Regards,
Cherry
Thank you! Worked perfectly 🙂
Hi @MrMarshall,
It is glad that we can help. Only thing that you'll have to notice, just always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.
Best Regards,
Cherry
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 90 | |
| 81 | |
| 66 | |
| 65 |