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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors