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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.