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

Can't round off percentages

Hey guys,

So in my power bi report, I have a measure which is the difference between two percentage measures.
NPS % = Promoter % -Detractor %
And I want them to calculate as 0 decimal places. I am able to show individual Promoter % and Detractor % as 74 % and 5 % but the difference is coming out incorrect. I have tried setting 0 in the measure tools for all measures but it's still showing 2 decimal values when i enable it in data label. I tried to set decimal places to 0 from the modelling view also but it still not coming correct

Please need help

 

Promoter_% = 
Var MaxYear=MAX('Fiscal Years'[FY])
Return
IF(ISFILTERED('Fiscal Years'[FY]),DIVIDE(CALCULATE(DISTINCTCOUNT('Responses received'[Dummy ID]),'Responses received'[Q1]>=9),[Total_Responses],0),

CALCULATE(DIVIDE(CALCULATE(DISTINCTCOUNT('Responses received'[Dummy ID]),'Responses received'[Q1]>=9),[Total_Responses],0),'Fiscal Years'[FY]=MaxYear))

Detractor % = 
var maxYear=MAX('Fiscal Years'[FY])
Return

IF(ISFILTERED('Fiscal Years'[FY]),DIVIDE(CALCULATE(DISTINCTCOUNT('Responses received'[Dummy ID]),'Responses received'[Q1]>=0 && 'Responses received'[Q1]<=6),[Total_Responses],0),

CALCULATE(DIVIDE(CALCULATE(DISTINCTCOUNT('Responses received'[Dummy ID]),'Responses received'[Q1]>=0 && 'Responses received'[Q1]<=6),[Total_Responses],0),'Fiscal Years'[FY]=maxYear))

NPS_% = 
Var maxYear=MAX('Fiscal Years'[FY])
Return
IF(ISFILTERED('Fiscal Years'[FY]),
    IF([Total_Responses]>0,[Promoter_%]-[Detract %]+0,

IF(([Promoter_%]-[Detract %])=0,"-",[Promoter_%]-[Detract %]
  )
     ),
IF([Total_Responses]>0 && ([Promoter_%]-[Detract %])=0 ,0,
CALCULATE(IF(
                ([Promoter_%]-[Detract %])=0,"-",[Promoter_%]-[Detract %]
            ),'Fiscal Years'[FY]=maxYear
        )
    ))

 

1 REPLY 1
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

 

You can try this. Put the decimal place to 0.

 

1.jpg

 

Regards,

Harsh Nathani

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