cancel
Showing results for 
Search instead for 
Did you mean: 
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

View solution in original post

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
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors