cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
mblydt-hansen Frequent Visitor
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
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!

5 REPLIES 5
Super User
Super User

Re: Excluding value in percent of group total

Hi,

 

Share some data and show the expected result.

mblydt-hansen Frequent Visitor
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.

mblydt-hansen Frequent Visitor
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
Super User

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.

mblydt-hansen Frequent Visitor
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!