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

how to calculate percentage

Hi All,

I need to calculate percenatge measure, same year i have Y & N and survey count.

Ex: Take FYweek as 202115 ==> if Flag = "N" then 67/(52+67)

                                                    if Flag = "Y" then 52(67+52)

 

Capture.JPG

regrad,

Navin_512

2 ACCEPTED SOLUTIONS
Pragati11
Super User
Super User

Hi @Anonymous ,

 

Create following calculated columns:

FyWeekSurveyCount = CALCULATE(SUM(FYSurvey[Survey Count]), FILTER(ALLSELECTED(FYSurvey), FYSurvey[FY Week] = EARLIER(FYSurvey[FY Week])))
 
FYWeekFlagSurveyCount = CALCULATE(SUM(FYSurvey[Survey Count]), FILTER(ALLSELECTED(FYSurvey), FYSurvey[FY Week] = EARLIER(FYSurvey[FY Week]) && FYSurvey[Flag] = EARLIER(FYSurvey[Flag])))
 
Then create a measure:
proportion = DIVIDE(SUM(FYSurvey[FYWeekFlagSurveyCount]), SUM(FYSurvey[FyWeekSurveyCount]), 0)
 
Convert the above measure to PERCENTAGE under Modelling tab.
 
Then move the following to the table visual, you will get something like below:
percentage.png
Hope this helps.
 
Thanks,
Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

1.jpg

 

 

 

 

Column =

var _sumFY = CALCULATE(SUM('Table'[Survery Count]),ALLEXCEPT('Table','Table'[FY Week]))

var _a = DIVIDE('Table'[Survery Count],_sumFY)

RETURN
_a
 
 
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , try like

divide(sum(Table[survey count]),calculate(sum(Table[survey count]),allexcept(Table,Table[FY Week]))

harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

1.jpg

 

 

 

 

Column =

var _sumFY = CALCULATE(SUM('Table'[Survery Count]),ALLEXCEPT('Table','Table'[FY Week]))

var _a = DIVIDE('Table'[Survery Count],_sumFY)

RETURN
_a
 
 
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Pragati11
Super User
Super User

Hi @Anonymous ,

 

Create following calculated columns:

FyWeekSurveyCount = CALCULATE(SUM(FYSurvey[Survey Count]), FILTER(ALLSELECTED(FYSurvey), FYSurvey[FY Week] = EARLIER(FYSurvey[FY Week])))
 
FYWeekFlagSurveyCount = CALCULATE(SUM(FYSurvey[Survey Count]), FILTER(ALLSELECTED(FYSurvey), FYSurvey[FY Week] = EARLIER(FYSurvey[FY Week]) && FYSurvey[Flag] = EARLIER(FYSurvey[Flag])))
 
Then create a measure:
proportion = DIVIDE(SUM(FYSurvey[FYWeekFlagSurveyCount]), SUM(FYSurvey[FyWeekSurveyCount]), 0)
 
Convert the above measure to PERCENTAGE under Modelling tab.
 
Then move the following to the table visual, you will get something like below:
percentage.png
Hope this helps.
 
Thanks,
Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

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.