Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Bamse
Frequent Visitor

Questions about lack of support for MEDIANX in GROUPBY / CURRENTGRUUP

I am using GROUPBY in several queries and are running into an issue.
According to Microsoft's documentation GROUPBY supports the aggregation (X) functions for grouping data.
But they also write that CURRENTGROUP on which it depends only supports a subset of the 'X' functions.
More specifically I am missing 'MEDIANX' which does not work with CURRENTGROUP and therefore not with GROUPBY.
I read some questions, also on this forum about this issue where people see it as a bug.


My question(s) are:
- Is it indeed a bug that MEDIANX is not supported, or is there some logic behind it?
- Is there a clever workaround (maybe with SUMMARIZE?) which produces the same results as GROUPBY, but with support for MEDIANX?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I've never in my life used GROUPBY, even though I've been practising DAX for more than 4 years and created huge commercial models.

There's no need for this 99.99999% of time. Use the combination of ADDCOLUMNS/SUMMARIZE. Beware, though, NOT to do any calculations under SUMMARIZE. Use it only for grouping rows. Nothing more. Deviate from this and you'll be in trouble in no time.

Best
D

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

I've never in my life used GROUPBY, even though I've been practising DAX for more than 4 years and created huge commercial models.

There's no need for this 99.99999% of time. Use the combination of ADDCOLUMNS/SUMMARIZE. Beware, though, NOT to do any calculations under SUMMARIZE. Use it only for grouping rows. Nothing more. Deviate from this and you'll be in trouble in no time.

Best
D
Anonymous
Not applicable

By the way, you don't have to use MEDIANX. You can use MEDIAN if you have the right filter context and just one column to calculate this value on.

Best
D

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors