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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
RichOB
Post Patron
Post Patron

Measure to calculate difference and percent please

Hi, I'm having trouble finding the correct measures that show the # difference and % difference between 2 values.

 

In this scenario each ID is 1 person and the ID Left is the total of them leaving the company:

 

MonthIDID Left
April45541
April43540
April 44460
April46781
May41121
May41321
May43331
May45891
June48710
June49990
June49890
June 40781

 

I need to show it as a table like below:

MonthIDID LeftDifference%
April425050%
May44100100%
June412525%

 

How can I do this, please?

 

Thanks in advance

 

3 ACCEPTED SOLUTIONS
Uzi2019
Super User
Super User

Hi @RichOB 

 

Try below dax

ID Count = COUNT(emp[ID])
 
count of Id Left = CALCULATE(COUNT(emp[ID]),FILTER(emp,emp[ID Left]=1))
 
Difference = ([count of Id Left]/[ID Count])
 

 

 

Uzi2019_1-1718890684377.png

 

I hope i answered your question!

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

View solution in original post

Ankur04
Resolver II
Resolver II

Hi, you can try created below measures and add them in table.

 

ID_Count = distinctcount(ID)

ID_left = sum(ID_left)

Difference % = [ID_left] /  [ID_Count ] *100

 

please let me know if this your expectation.

View solution in original post

Anonymous
Not applicable

Hi @Uzi2019 , @Ankur04 ,Thank you for your quick reply, I will add more.

Hi @RichOB ,

Try this.

_Timeline = COUNT('Table'[Timeline])
_Planned = COUNTX(FILTER('Table','Table'[Planned] = 1),[Timeline])
Difference = DIVIDE([_Planned],[_Timeline]) 

If your column names change, edit here.(Replace 'Table' with your own table name)

vzhouwenmsft_0-1719193447173.png

vzhouwenmsft_1-1719193499200.png

Final output

vzhouwenmsft_2-1719193519549.png

 

View solution in original post

6 REPLIES 6
Ankur04
Resolver II
Resolver II

Hi, you can try created below measures and add them in table.

 

ID_Count = distinctcount(ID)

ID_left = sum(ID_left)

Difference % = [ID_left] /  [ID_Count ] *100

 

please let me know if this your expectation.

Hi, thanks for your help!

 

How would that measure look if the column headers changed to this, please? I tried to replicate but I couldn't get it.

 

MonthTimelinePlanned
April45541
April43540
April 44460
April46781
May41121
May41321
May43331
May45891
June48710
June49990
June49890
June 40781
Anonymous
Not applicable

Hi @Uzi2019 , @Ankur04 ,Thank you for your quick reply, I will add more.

Hi @RichOB ,

Try this.

_Timeline = COUNT('Table'[Timeline])
_Planned = COUNTX(FILTER('Table','Table'[Planned] = 1),[Timeline])
Difference = DIVIDE([_Planned],[_Timeline]) 

If your column names change, edit here.(Replace 'Table' with your own table name)

vzhouwenmsft_0-1719193447173.png

vzhouwenmsft_1-1719193499200.png

Final output

vzhouwenmsft_2-1719193519549.png

 

Uzi2019
Super User
Super User

Hi @RichOB 

 

Try below dax

ID Count = COUNT(emp[ID])
 
count of Id Left = CALCULATE(COUNT(emp[ID]),FILTER(emp,emp[ID Left]=1))
 
Difference = ([count of Id Left]/[ID Count])
 

 

 

Uzi2019_1-1718890684377.png

 

I hope i answered your question!

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!
Uzi2019
Super User
Super User

Hi @RichOB 

 

Try below dax

ID Count = COUNT(emp[ID])
 
count of Id Left = CALCULATE(COUNT(emp[ID]),FILTER(emp,emp[ID Left]=1))
 
Difference = ([count of Id Left]/[ID Count])
 

 

 

Uzi2019_1-1718890684377.png

 

I hope i answered your question!

 

 

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Hi, Thanks for your help!

 

How would that look if the column headers changed to the below, please?

 

MonthTimelinePlanned
April45541
April43540
April 44460
April46781
May41121
May41321
May43331
May45891
June48710
June49990
June49890
June 40781

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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