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
Anonymous
Not applicable

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

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)
Anonymous
Not applicable

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

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
Anonymous
Not applicable

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.  

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)
Anonymous
Not applicable

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

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.

Top Solution Authors