cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mrmiyagi
Helper III
Helper III

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
iamprajot
Responsive Resident
Responsive Resident

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
iamprajot
Responsive Resident
Responsive Resident

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)

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

iamprajot
Responsive Resident
Responsive Resident

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

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.  

iamprajot
Responsive Resident
Responsive Resident

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

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

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors