cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper III
Helper III

MEDIANX to ignore Blank or zeros

Hi,

 

I have the following measure:

MEDIANX( 'All Store Info',
DIVIDE('All Store Info'[Turnover],'All Store Info'[Transactions]) + 'Increase of Basket Value'[Increase of Basket Value Value]
Which is meant to esablish the increased basket value for each store per day (based on a increase basket value slider)
This work perfectly on a row by row basis. However when drilling up to monthly the MEDIANX used is taking blanks and zeros
into acocunt and producing lower numbers.
Is there a way to get Medianx to ignore blanks?
 
Thanks
 
 
4 REPLIES 4
Highlighted
Super User IV
Super User IV

Re: MEDIANX to ignore Blank or zeros

Can you filter avoid the blank rows? It Agg is coming zero

in case of row is zero and you want to avoid

MEDIANX( filter('All Store Info',condition to filter),

 

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
My Recent Blog -Week is not so Weak Connect on Linkedin

Proud to be a Super User!

Highlighted
Community Support
Community Support

Re: MEDIANX to ignore Blank or zeros

Hi @duggy ,

 

I think you should create a calculated column not a measre in your scenario. Here we can update the formula as below.

MEDIANFilter = 
IF (
    'All Store Info'[Turnover] = BLANK (),
    BLANK (),
    MEDIANX (
        FILTER ( 'All Store Info', 'All Store Info'[Turnover] <> BLANK () ),
        DIVIDE ( 'All Store Info'[Turnover], 'All Store Info'[Transactions] )
    )
)

Capture.PNG

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Highlighted
Helper III
Helper III

Re: MEDIANX to ignore Blank or zeros

That would be ideal however the reason I used the measure is that I need to get the value of the slider.

 

Basically the user can slide the slider and select the amount to add:

MEDIANX( 'All Store Info',
DIVIDE('All Store Info'[Turnover],'All Store Info'[Transactions]) + 'Increase of Basket Value'[Increase of Basket Value Value]
)
The +'Increase of Basket Value'[Increase of Basket Value Value]. If I was able to access this value then I can do the calculated column, but it seems I can only access it from measure.
 

 

 

Highlighted
Regular Visitor

Re: MEDIANX to ignore Blank or zeros

I had a similar problem in a What-if scenario, but worked around it by using a variable and wrapping the result in an IF that would return FALSE if blank/0 which forces the MEDIANX to ignore the result.

MEDIANX (
    'All Store Info',
    VAR _Result =
        DIVIDE ( 'All Store Info'[Turnover], 'All Store Info'[Transactions] ) + 'Increase of Basket Value'[Increase of Basket Value Value]
    RETURN
        IF ( _Result <> 0_ResultFALSE () )
)

Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors