Forum Discussion

carlol's avatar
carlol
Icon for Resolver I rankResolver I
4 years ago
Solved

DAX Grouping Sets?

 

Can you have a grouping set in Dax 

 

I want to create a Total by National and by Hospital , I can easily do in SQL and import to power BI , I want to replicate in Dax within the Dimensional Model

 

SQL 

 

Select
[SurgeryDate],
ISNULL([HospitalID],9999)As[Hospital], --9999 represents National
[ProcedureID],
Sum([NumOfProcedures])As Denominator -- All Surgeries
From CTE
Group By
Grouping Sets
(
(--National

[SurgeryDate],
[ProcedureID]

),
(--Hospital
[HospitalID],
[SurgeryDate],
[ProcedureID]
)
)
Order By [HospitalID]

 

Result

  • Anonymous's avatar
    Anonymous
    4 years ago

    AFAIK, there is no concept of "grouping sets" in DAX. In DAX you just slice and dice by the right dimensions.

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    AFAIK, there is no concept of "grouping sets" in DAX. In DAX you just slice and dice by the right dimensions.