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
vdf
Regular Visitor

Percentage between two fields

Hi,

 

I am trying to get a percentage between two fields but for some reason is not given the correct result:

 

Pct Total = IFERROR(1-(Repeat / Contact),0) I am getting the following result

Pct Total = IFERROR(1-(6861 / 22772),0) - NaN

I also get

Pct Total = IFERROR(1-(75 / 278),0) - 1164%

 

Any help is very much appreciated,

 

Thanks,

2 ACCEPTED SOLUTIONS

Hi @vdf

Please right click your fields(1stContact_7,Repeat_7,Column 3,Pct Total) in the Field Panel as shown in the following screenshot, then choose"Don't summarize", then your Column 3 and Pct Total should show correctly.

1.PNG2.PNG

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @vdf

Please create new measures using the following formulas.

SumRepeat_7 = SUM(data[Repeat_7])
Sum1stContact_7 = SUM(data[1stContact_7])
Sum1stContact_7 = SUM(data[1stContact_7])

Then create a visual as follows and check if it resturns your desired result. For more details, check this modified PBIX file.
1.PNG

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-yuezhe-msft
Employee
Employee

Hi @vdf,

I test the scenario as yours, but I am not able to reproduce your issue. You can check the example in the following screenshot, for more details, please review the attached PBIX file.
1.PNG

In your scenario, what is the data type of the two fields(Repeat and Contact)?  And what is the result if you use the following formula to create new column instead?

Column 3 = IF(Table3[Contact]=0,
   0,
   1-(Table3[Repeat]/Table3[Contact]))



Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Lydia,

 

Many thanks for your reply, but I am really in a muddle Smiley Sad, I am new to Power BI, so all the help is greatly appreciated. I've tryied to 'copy' your formula but still do not work, I enclosed what I've done ftr-community, could you check where I am wrong, please?

Kind regards,

Hi @vdf

Please right click your fields(1stContact_7,Repeat_7,Column 3,Pct Total) in the Field Panel as shown in the following screenshot, then choose"Don't summarize", then your Column 3 and Pct Total should show correctly.

1.PNG2.PNG

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Many thnks Lydia,

 

Solution worked, but this gives me the result for each row, is there anyway that I can have it grouped by [v_site]?

 

Thanks again,

Hi @vdf

Please create new measures using the following formulas.

SumRepeat_7 = SUM(data[Repeat_7])
Sum1stContact_7 = SUM(data[1stContact_7])
Sum1stContact_7 = SUM(data[1stContact_7])

Then create a visual as follows and check if it resturns your desired result. For more details, check this modified PBIX file.
1.PNG

Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.