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 moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I've a table of purchased items stored in the Data Warehouse. The table has almost 20 million records. The table maintains daily transactions and hence the number if rows is huge.
I want to find a way where I can group the entries in the table where I can group items for each month for each customer.
So transfer the example table below:
| Date (DD/MM/YYYY) | Material # | QTY | group | Customer |
| 1/2/2023 | PN123 | 3 | Stationary | A |
| 1/2/2023 | BK123 | 3 | Stationary | B |
| 2/2/2023 | PN123 | 2 | Stationary | A |
| 3/2/2023 | PN123 | 6 | Stationary | B |
| 1/3/2023 | LT123 | 4 | IT | A |
| 1/3/2023 | NB123 | 3 | IT | B |
| 2/3/2023 | PN123 | 6 | Stationary | A |
| 3/3/2023 | BK123 | 3 | Stationary | B |
| 4/3/2023 | MS123 | 2 | IT | B |
To be similar to this one
| Date | Material | Goup | Customer | QTY |
| Feb-23 | PN123 | Stationary | A | 5 |
| Feb-23 | BK123 | Stationary | B | 3 |
| Feb-23 | PN123 | Stationary | B | 6 |
I want to do this as I load the data from the Data Warehouse
Solved! Go to Solution.
Hey @Anonymous !
You can write your SQL like below:
SELECT
Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI
Hey @Anonymous !
Can you write a SQL to extract the data? If yes, you can try use a group BY, or even create a view to reduce.
If you can write a SQL, you can use the Group BY function on Power Query (Group By in Power BI using Power Query Editor - SqlSkull).
If this helps, please mark this question as solved to help people find quickly in our community!
Regards,
Marcel
Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI
Thanks. Yes, I can write SQL statement as I import the data from Oracle DB.
I'm not expert with SQL, so I was wondering how would grouping discard the data and just keep the month and year?
Hey @Anonymous !
You can write your SQL like below:
SELECT
Regards,
Marcel Magalhães
Microsoft Power BI Official Partner
MCT | Certified PL-300 Power BI
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 |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 67 | |
| 63 | |
| 30 | |
| 30 | |
| 23 |