Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. 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
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 52 | |
| 38 | |
| 37 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 67 | |
| 67 | |
| 34 | |
| 32 | |
| 29 |