Power BI · मराठी आवृत्ती
7.23 Group By: Basic आणि Advanced
खाली rows order-line grain वर आहेत. Pune साठी तीन lines, पण दोन वेगळ्या orders आहेत.
| City | Order ID | Amount |
|---|---|---|
| Pune | BLK-1 | 120 |
| Pune | BLK-1 | 80 |
| Pune | BLK-2 | 300 |
| Nashik | BLK-3 | 150 |
| City | Total Sales | Order Lines | Orders |
|---|---|---|---|
| Pune | 500 | 3 | 2 |
| Nashik | 150 | 1 | 1 |
- Home किंवा Transform › Group By उघडा.
- Basic मध्ये City, नवीन नाव Order Lines, operation Count Rows निवडा.
- Advanced मध्ये City + Platform grouping; Total Sales = Amount Sum, Order Lines = Count Rows, Avg Delivery = Average, Details = All Rows अशा aggregations जोडा.
- एका column चा distinct count हवा तर formula edit करून
each List.Count(List.Distinct([Order ID]))वापरा.
Grouped = Table.Group(Source, {"City"}, {
{"Total Sales", each List.Sum([Amount]), type number},
{"Order Lines", each Table.RowCount(_), Int64.Type},
{"Orders", each List.Count(List.Distinct([Order ID])), Int64.Type}
})
Sum, Average, Median, Min, Max, Percentile, Count Rows, Count Distinct Rows, All Rows यांपैकी उपलब्ध options version नुसार बदलतात. Count Distinct Rows पूर्ण rows मोजतो; unique Order ID नाही. Delivery time line-level average चं weighting वेगळं असू शकतं; order-level metric हवा तर आधी योग्य grain ठरवा.
Grouping नंतर detail या query मध्ये राहत नाही. बहुतेक reports मध्ये detailed data load करून DAX measures वापरतात. Summary table, quality counts किंवा मोठा data कमी करण्यासाठी Power Query Group By योग्य.
Practice
Store ID + Order Date नुसार Daily Store Summary करा: distinct Orders, Total Sales आणि Max Delivery Time Mins.