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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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

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
Ashish_Mathur
Super User
Super User

Hi,

 

Share some data and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

This is my data.This is my data.These 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.These 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.

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/

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!

This is my data.This is my data.These 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.These 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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.