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

Percent difference based on text values

I could use some guidance on how to get a measure to show the percentage difference between text values in a column "SUBREGION". I have created a measure to count each text value that equals "M COUNTY" which is a resident but now I need to get the percent difference between that vs all other subregions who are non residents.  I appreciate any help on this! 

 

CountResident = CALCULATE(COUNT(TABLE[Subregion]),'TABLE'[Subregion] = "M County")

 

GOAL

Percent difference 

RESIDENT (M COUNTY) vs NON RESIDENT (ALL OTHER SUBREGIONS that are not M COUNTY)  

 

county.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Responsive Resident
Responsive Resident

Re: Percent difference based on text values

Use this then,
Result =
VAR CountResident = CALCULATE(COUNT(TABLE[Subregion]),'TABLE'[Subregion] = "M County")
VAR AllCountResident = CALCULATE(COUNT(TABLE[Subregion]),'TABLE'[Subregion] <> "M County")
RETURN
DIVIDE (CountResident, NonCountResident, 0)

View solution in original post

6 REPLIES 6
Highlighted
Responsive Resident
Responsive Resident

Re: Percent difference based on text values

I think it is fairly simple. Take the count of Residents and Divide them with the all-residents
Use below
Result =
VAR CountResident = CALCULATE(COUNT(TABLE[Subregion]),'TABLE'[Subregion] = "M County")
VAR AllCountResident = CALCULATE(COUNT(TABLE[Subregion]),ALL(TABLE))
RETURN
DIVIDE (CountResident, NonCountResident, 0)
Highlighted
Helper II
Helper II

Re: Percent difference based on text values

Thank you for the prompt response and help! I did use your formula but I don't think it showing the correct percent? Shouldn't it be like 89%? Also do you know how to show the card as a percent?  

 

totalcount.PNG

Highlighted
Responsive Resident
Responsive Resident

Re: Percent difference based on text values

Select this measure and go to modeling in the top ribbon and choose percentage as data type.
Do you want the percentage of M Residents or the difference between M Residemts and Non M Residents
Highlighted
Helper II
Helper II

Re: Percent difference based on text values

Thank you! I need percent of M County residents vs non residents (all other). So I need to see percentage of M County (residents) who registered against the non-residents.  

Highlighted
Responsive Resident
Responsive Resident

Re: Percent difference based on text values

Use this then,
Result =
VAR CountResident = CALCULATE(COUNT(TABLE[Subregion]),'TABLE'[Subregion] = "M County")
VAR AllCountResident = CALCULATE(COUNT(TABLE[Subregion]),'TABLE'[Subregion] <> "M County")
RETURN
DIVIDE (CountResident, NonCountResident, 0)

View solution in original post

Highlighted
Helper II
Helper II

Re: Percent difference based on text values

Awesome it worked! Thank you so much for all your help

Helpful resources

Announcements
June 2020 Community Highlights

June 2020 Community Highlights

Featured community members, changes to the Community, and more! Read up on recent Power BI community news.

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