Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

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

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

     

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

     

     

    Regards,

    Harsh Nathani