Forum Discussion
Anonymous
7 years agoNot applicable
Need help getting to % on filtered data
I think there is a simple answer to what I'm trying to do, but I've been looking at it too long and can't see the forest through the trees now. Given a table of survey responses, using the CARD visu...
- 7 years ago
I would solve by creating TWO new columns in your table.
Dissatisfied = IF(SurveyResponses[Satisfaction]="Dissatisfied",1,0)Satisfied = IF(SurveyResponses[Satisfaction]="Satisfied",1,0)I would then create these measuresTotal Dissatisified = SUM(SurveyResponses[Dissatisfied])Total Satisfied = SUM(SurveyResponses[Satisfied])Total Survey = [Total Satisfied]+[Total Dissatisified]%Satisfied = [Total Satisfied]/[Total Survey] "You need to format this as a percentage"After you do all of the above then drag the %Satisified measure into the Values field for your card.That would be my approach, your mileage may vary. - 7 years ago
Hi Dan,
Try this measure.
% of Satisfied Responses =var satisfiedResponses = CALCULATE(COUNT(SurveyResponses[Satisfaction]), LOWER(SurveyResponses[Satisfaction]) = "satisfied")var totalResponses = CALCULATE(COUNT(SurveyResponses[Satisfaction]))RETURN IF(ISBLANK(satisfiedResponses), 0, CALCULATE(DIVIDE(satisfiedResponses, totalResponses,0)))And with this field selected, go to Modeling tab, change the Formatting to %; set the decimal places per your need.Regards,Tarun
Did I answer your question? Mark my post as a solution!
knotpc
Advocate I
7 years agoI would solve by creating TWO new columns in your table.
Dissatisfied = IF(SurveyResponses[Satisfaction]="Dissatisfied",1,0)
Satisfied = IF(SurveyResponses[Satisfaction]="Satisfied",1,0)
I would then create these measures
Total Dissatisified = SUM(SurveyResponses[Dissatisfied])
Total Satisfied = SUM(SurveyResponses[Satisfied])
Total Survey = [Total Satisfied]+[Total Dissatisified]
%Satisfied = [Total Satisfied]/[Total Survey] "You need to format this as a percentage"
After you do all of the above then drag the %Satisified measure into the Values field for your card.
That would be my approach, your mileage may vary.
Anonymous
7 years agoNot applicable
Thank you, this was the solution I chose to move forward with, even though the other solution worked too. Thanks a bunch!