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

View solution in original post

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.

Highlighted
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!

View solution in original post

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 58 members 1,181 guests
Please welcome our newest community members: