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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
hyndmanevanp
Helper I
Helper I

MEDIANX returns blank, MAXX and MINX work

I'm linked to our companies QuickBooks Online data.  I'm trying to display the Max, Median, and Min for client hours.  We have four regions and four client types.  I'm using the Items table to separate client types.  I'm using the Multi-Row Card visual to display and using the visual filters to isolate one month and office.  My measure is:

 

Hours_Private_Median = MEDIANX(DISTINCT(Invoice[CustomreRef_Name], CALCULATE(SUM(Invoice[Line_Detail_Qty]), 'Item'[Fully_Qualified_Name]="Private"))

 

When I use this is MAXX and MINX, it works, and I've cross referrenced it to a separate data set.  I've replaced MEDIANX in the working MAXX measure incase I had an unseen entry error, but it returns blank when changed.  Further, when I change regions, some client types return an incorrect number, whereas some client types always return blank MEDIANX.  Images below.  

 

Region 1 - All Median blank

hyndmanevanp_0-1702484252929.png

 

Region 2 - Private return incorrect amount

hyndmanevanp_1-1702484305853.png

Region 2 Cluster Column Chart with Median constant line on (48)

hyndmanevanp_2-1702484381808.png

Thank you

3 REPLIES 3
WinterMist
Impactful Individual
Impactful Individual

@hyndmanevanp 

 

This is going to depend on your data. 

 

Please check out this article.

 

https://exceleratorbi.com.au/medianx-returns-blank-in-dax-part-1/

 

Regards,

Nathan

@WinterMist 

 

Thank you for the link above.  The author talked about the handling of blanks in DAX vs visual.  He solved it using something called DAX Studio, I'm not sure what that is.  I went to my data and removed empty cells, if existent, from the Invoice ID and Line Qty columns, but it didn't change my results.

@WinterMist 

One additional comment:  I have a measure to capture the hours of each client type, that measure in inbedded in the one from my first post:

 

Hours_Private = CALCULATE(SUM(Invoice[Line_Detail_Qty]), 'Item[Fully_Qualified_Name]="Private"))

 

I can use the measure above and create another measure using regular MAX and MIN, but on only returns the max and min of each individual line item, not summed, however when I try MEDIAN, it won't even allow Hours_Private as an option.  I'm adding this incase it can be used in another measure.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.