12. Data Hierarchies and Groups
12.7 Groups vs Calculated Columns vs Hierarchies
| Group (list/bin) | Calculated column / Power Query column | Hierarchy | |
|---|---|---|---|
| Purpose | Combine values into categories | Any row-level logic | Drill from general to detailed |
| Created with | Right-click › New group (no code) | DAX SWITCH / M conditional column |
Right-click › Create hierarchy |
| Flexibility | Simple membership or equal-width ranges | Unlimited (conditions, other columns, other tables) | Only orders existing columns |
| Maintenance | Easy for business users; dialog-based | Needs formula edits (or a mapping table) | Easy |
| Example | Region (West, Vidarbha …); Delivery time bins of 5 | Delivery Speed Band with custom limits 0–10, 11–15, 16–30, 30+ | State › City › Area › Store |
| Use in hierarchy? | Yes (a group can be a level, e.g. Region › City) | Yes | – |
Combine them
Mhanje asa: create the Region group, then build a hierarchy Region › City › Area › Store Name. Now a map or matrix can drill from West to Pune to Kothrud.
Practice task
Implement Region twice, once as a group and once as a DAX calculated column with SWITCH. Compare the results and write two lines on which one you would hand over to a business user.
Ravindra Bagale's Tip
Friends, many students use groups for logic that changes every month, and then edit the group by hand each time. Use a group for quick, stable buckets. Use a Power Query mapping table or a calculated column when the rules are complex, need documenting or must be reused in other reports. Don't worry – after doing it two or three times, it becomes a habit.
Ravindra Bagale's Tip – मराठी
मित्रांनो, बरेच students दर महिन्याला बदलणाऱ्या logic साठी groups वापरतात, आणि मग प्रत्येक वेळी group हाताने edit करतात. पटकन बनणाऱ्या, स्थिर buckets साठी group वापरा. Rules complex असतील, document करायचे असतील किंवा इतर reports मध्ये पुन्हा वापरायचे असतील तर Power Query mapping table किंवा calculated column वापरा. घाबरू नका, दोन-तीन वेळा केलं की सवय होते.
Ravindra Bagale's Tip – हिंदी
दोस्तों, बहुत से students हर महीने बदलने वाले logic के लिए groups इस्तेमाल करते हैं, और फिर हर बार group को हाथ से edit करते हैं. जल्दी बनने वाले, स्थिर buckets के लिए group इस्तेमाल करो. Rules complex हों, document करने हों या दूसरी reports में दोबारा इस्तेमाल करने हों तो Power Query mapping table या calculated column इस्तेमाल करो. घबराओ मत, दो-तीन बार करने पर आदत हो जाती है.
Thodkyaat sangaycha tar (quick recap)
Hierarchy mhanje drill path, group mhanje buckets. Sagle levels ekach table madhe hava, Other group visru naka, aani bins banvnyaadhi outliers (बाकीपेक्षा खूप वेगळे, असामान्य मूल्य) saaf kara. Aata pudhe jaauya – DAX, mhanje Power BI cha "brain"!