FYI I found a couple of bugs with GROUPING about a month ago and raised an internal bug.
The 2 issues are...
1. GROUPING( <column name> ) returns 1 when should be 0 and 0 when should be 1
2. GROUPING can return values > 1.
Good news - the issue has been fixed internally so is just waiting to be merged into internal releases/testing etc.
regards,
Alan