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
unnijoy
Post Partisan
Post Partisan

survay count based on condition

I have a Survey data with me. We calulate the peope who give rating from 4-5 as Promoter, 3-2 as Neutral and 1 as demoters.

 

The condetion is that if the survay resopnse is less than 5 we should not consider then for calculation. than means some times we get only 2 or 3 response from some country or city. 

the challenge that i am facing is that i calculate total survey count based on the count of survay ID. and i put the count od survay id in visula filter as the condetion as if the survaly count is >= 5 then show value.

 

the issue is that when i put table or graph with drill down with region ,country and city the value is showing incorrect. for example in the below table from Canada we got only 2 survay. as we already put the condetion in the visula, in the region visula it exclude the values from Canada. How can i include Canada value in the region, but when i drill down to country it should not show Canada Value.

 

so as per the below table for NA region promoter = 3 , Neutral = 3 & Demoter = 1

when i drill down to country it showuld not show Canada data as the total response from Canada is less than 5.

survay dummy.png

2 ACCEPTED SOLUTIONS

@unnijoy  You have not provided much detail on your issue: 

 

1) Please in future if you paste actual table instead of screenshot we can help much faster. For example: 

 

Sur ID Region Country City Rating
12 NA US LA 3
23 NA US LA 4
43 NA US LA 2
23 NA US LA 5
87 NA US LA 1
47 NA CANADA NIA 4
45 NA CANADA NIA 3

 

2) Please provide your DAX code in addition to description of what it should do (both are helpful and needed for us to help troubleshoot). Since I don't know which approach you are currently using in your DAX, I've just started from scratch: 

 

Total Responses = DISTINCTCOUNT(RawData[Sur ID])
 
Promoters Count =
IF( [Total Responses] >=4,
CALCULATE([Total Responses],FILTER(RawData, RawData[Rating] >=4)))
 

3) What is your desired outcome? Your sample data has duplicate Sur ID which I have only counted once, but not sure how you would handle these???

 

AllisonKennedy_0-1633947498387.png

 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

@AllisonKennedy ,

 

Thank you so much. It worked.

View solution in original post

5 REPLIES 5
AllisonKennedy
Super User
Super User

@unnijoy So you're wanting Canada calculated in the total, but show as blank if it is in scope?

 

What does your data model look like? https://excelwithallison.blogspot.com/2020/11/power-bi-webinar-survey-says.html 

 

Do you have a Dim table for Respondents? 

 

Reply to this post with:

  • @ mention me
  • a screenshot of your data model/relationships
  • paste directly into this post a table of sample data of survey responses
  • paste directly into this post your current DAX measure for NPS

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@AllisonKennedy ,

 

their are no other tables to create relashinship. and the model looks same. Currently i am taking the Survay by counting the Survey ID. And i put this Survay id measure in the visula filter and set the condition as greater than or equal to 5. I tought when i take the region it will include Canada and when i drill donw to coutry it will exclude Canada. But now from region also it is not taking Canada. How can i do this.

@unnijoy  You have not provided much detail on your issue: 

 

1) Please in future if you paste actual table instead of screenshot we can help much faster. For example: 

 

Sur ID Region Country City Rating
12 NA US LA 3
23 NA US LA 4
43 NA US LA 2
23 NA US LA 5
87 NA US LA 1
47 NA CANADA NIA 4
45 NA CANADA NIA 3

 

2) Please provide your DAX code in addition to description of what it should do (both are helpful and needed for us to help troubleshoot). Since I don't know which approach you are currently using in your DAX, I've just started from scratch: 

 

Total Responses = DISTINCTCOUNT(RawData[Sur ID])
 
Promoters Count =
IF( [Total Responses] >=4,
CALCULATE([Total Responses],FILTER(RawData, RawData[Rating] >=4)))
 

3) What is your desired outcome? Your sample data has duplicate Sur ID which I have only counted once, but not sure how you would handle these???

 

AllisonKennedy_0-1633947498387.png

 


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@AllisonKennedy ,

 

Thank you so much. It worked.

Yay! you're welcome.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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.