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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Anonymous
Not applicable

MEDIANX DAX

Hi 

 

I have a problem with getting MEDIANX to function.

 

I want to change this formular from Average to Median: 

 

GNSpurchase = AVERAGE('GAdata'[purchase])

 

I'm just not sure what to do from here

 

I have tried this:

 

GNSview = CALCULATE(MEDIANX(GAdata;GAdata[Views]))
 
It tells me something about "a circular dependency was detected" and the output is blanks in every cell. 
 
 
Hope you can help me. Thx.

 

 

 

 

13 REPLIES 13
az38
Community Champion
Community Champion

Hi @Anonymous 

try without calculate

= MEDIANX(GAdata;GAdata[Views])

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

Does not work - unfortunately 😞

 

When I do that, it says: "Expression that yield variant data type error cannot be used to defined calculated columns".

az38
Community Champion
Community Champion

@Anonymous 

are you sure your Views column is a number? check in the Power Query mode. choose column and set whole or decimal number as data type in the Transform ribbon

and try to create measure, not calculated column

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

The View column is definitely a number - without decimals as well.

 

Can you give an example of measure?

 

 

az38
Community Champion
Community Champion

@Anonymous 

the same as column, but measure.

anyway it looks like your data in Views is inconsistent. maybe you have a null values? if so, you should to solve what to do - delete from calculation or change it to 0 (preferrably in Query Editor mode)

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

@az38 

 

I don't have any null value in the View column. However, I have a lot of zero values. Hmmm....

az38
Community Champion
Community Champion

@Anonymous you could share your pbix-file to check it out


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

@az38 

 

Can't see  where to share pbix-files... lol. I don't see an upload file function..?

az38
Community Champion
Community Champion

@Anonymous there is no upload function (only for admin) use for example https://uploadfiles.io/ service

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

@az38 

 

Ok, cool, thx.

 

https://ufile.io/9jzeyjpm

 

 

az38
Community Champion
Community Champion

@Anonymous 

if you create measure, not calculated column it should work

Measure = MEDIANX(GAdata;GAdata[Views])

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn
Anonymous
Not applicable

@az38 

 

Copied your formular but it is not working - unfortunately. 

 

Thanks for the effort though.

 

 

 

az38
Community Champion
Community Champion

@Anonymous  really?

https://ufile.io/7c10lawz

look at Measure

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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