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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors