Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi ,
I am trying to work out the 'POWER QUERY' formula for obtaining the 'First Invoice' date of each customer.
| Date | Account_Id | Revenue |
| 30/04/2021 | 10 | 15 |
| 30/03/2021 | 10 | 155 |
| 30/04/2021 | 11 | 14 |
| 30/04/2021 | 12 | 16 |
| 29/02/2020 | 11 | 122 |
My Table is pretty basic only contains date of invoice, account_id and revenue.
I would expect the results to show as :
| Date | Account_Id | Revenue | First Invoice |
| 30/04/2021 | 10 | 15 | 30/03/2021 |
| 30/03/2021 | 10 | 155 | 30/03/2021 |
| 30/04/2021 | 11 | 14 | 29/02/2020 |
30/04/2021 | 12 | 16 | 30/04/2021 |
29/02/2020 | 11 | 122 | 29/02/2020 |
I have the DAX formula - but for what i am trying to accomplish i require the Query equivalent.
FirstInvoiceDate = CALCULATE(MIN([Date]),ALLEXCEPT([Account_Id]))
Solved! Go to Solution.
Lots of ways to do it.
Using the interface:
Select the Account Id column.
Do a 'Group By' (which will be on Account Id) and choose Advanced with an aggregation of Min on Date and then another on All Rows.
Then Expand the column header from all to return Date and Revenue
Thank you - this worked.
Out of curiousity what other ways could this be done in PowerQueryEditor?
Lots of ways to do it.
Using the interface:
Select the Account Id column.
Do a 'Group By' (which will be on Account Id) and choose Advanced with an aggregation of Min on Date and then another on All Rows.
Then Expand the column header from all to return Date and Revenue
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 46 | |
| 41 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 69 | |
| 32 | |
| 27 | |
| 26 |