My solution is based on function SUMMARIZECOLUMNS that creates a virtual table.
Post Category → DAX
Dynamic Segmentation Table
In my last post I cautioned against using DAX to create a physical table. Segmentation Tables (aka Disconnected) are an exception and worth learning!
SUMMARIZE saves the day
Question 1 is easy. Question 2 is tricky. It requires a virtual summary group by table. A what?
Measure Uses Virtual Table
Some questions require a virtual table inside a measure to create the required data structure.