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
POSPOS
Post Partisan
Post Partisan

Get min date for a group in M Query Power Query Editor

Hi All,

I have a requirement to display the min date when status=Assigning in M query.
Sample data:

POSPOS_0-1707235492492.png

Requirement: My final table will need to have only one line per order. Now we are having multiple statuses for one order number.
Show only status=Assigning by picking the first date when there are more than one dates for status=Assigning and remove all other statuses using M query and not using DAX.
Sample pbix is available here.

Thank you

2 REPLIES 2
amitchandak
Super User
Super User

@POSPOS , Add a new column in power query use the correct table name from the last step of your query

 

let
_val = [order number]
_min = List.Min(Table.SelectRows(#"Last Step table name", each [order number] = _val)[Effective Date])
return
_min

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak Thanks.
I get a syntax error. Can you pls suggest:

POSPOS_0-1707251719825.png

 

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.