cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mblydt-hansen
Frequent Visitor

Excluding value in percent of group total

Hi everyone!

 

I was wondering if someone could help me with coding a measure. The goal of the measure is to display the percent of a group total for certain text values (when multiple groups exist). I`ve already written some code that does this successfully (see below). My issue is that, within my stage column, a large proportion of the text values are null, and unfortunately these null values are being given their own percents of the group total and are messing up the calculations for all the other non-null values (removing by basic filtering within a visualization does not solve this as the percentages are already calculated). I am still teaching myself DAX and I was hoping that someone would be able to ammend my code such that null values within the stage column are excluded when the percentages are calculated. I appreciate that this probably a straightforward fix - thanks in advance!

Percent with different BPs = 
DIVIDE (
    COUNTA ( 'BloodPressureStatus'[Patient.ID]),
    CALCULATE ( COUNTA ( 'BloodPressureStatus'[Patient.ID]), ALL( 'BloodPressureStatus'[stage])
))
1 ACCEPTED SOLUTION

Accepted Solutions
mblydt-hansen
Frequent Visitor

Re: Excluding value in percent of group total

Hi,

 

Thanks for the reply! I was able to solve my issue with a simple fix. I just did a power query and excluded the "null" values from the [stage] column - not sure why I didn't think of it before. I appreciate your help regardless!

View solution in original post

5 REPLIES 5
Super User IV
Super User IV

Re: Excluding value in percent of group total

Hi,

 

Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
mblydt-hansen
Frequent Visitor

Re: Excluding value in percent of group total

2018-08-12 (1).pngThis is my data.2018-08-12.pngThese are 2 bar graphs with that data. When the null percentile is excluded (the graph on the right), the other percent values don't adjust, and I would like them to.

Highlighted
mblydt-hansen
Frequent Visitor

Re: Excluding value in percent of group total

2018-08-12 (1).pngThis is my data.2018-08-12.pngThese are 2 bar graphs with that data. When the null percentile is excluded (the graph on the right), the other percent values don't adjust, and I would like them to.

Super User IV
Super User IV

Re: Excluding value in percent of group total

Hi,

 

Share the link from where i can download your PBI file and please also show the expected result there.  Show the resul in a simple Table.  Once we have the correct figures in a Table, a graph can be easily created.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
mblydt-hansen
Frequent Visitor

Re: Excluding value in percent of group total

Hi,

 

Thanks for the reply! I was able to solve my issue with a simple fix. I just did a power query and excluded the "null" values from the [stage] column - not sure why I didn't think of it before. I appreciate your help regardless!

View solution in original post

Helpful resources

Announcements
Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors