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
saud968
Responsive Resident
Responsive Resident

Multiple values from same column under same visual

I want to showcase two columns in one visual by taking specific count values. From the CSAT column in the visual one column will show a count of 4, 5 for a PCM and the other will show 1,2,3. 

 

I have tried this C-SAT = CALCULATE(COUNTROWS(CSAT), FILTER(CSAT, CSAT[CSAT] = 4 && 5 )) and C-SAT = CALCULATE(COUNT(CSAT), FILTER(CSAT, CSAT[CSAT] = 4 && 5 )) but it is now working it is not giving the correct count

 

Case NumberResponded Date
(America/Cancun)
Closed Date
(America/Cancun)
CSATCESCommentsPCMProductInquiry/Problem/Request
1542477/1/2021 1:30 AM7/1/2021 1:29 AM55 Saud AnsariFortifyProblem
1210321/30/2021 4:08 AM1/22/2021 5:33 PM55 Salman PatelPortalInquiry
1213712/2/2021 4:04 PM1/26/2021 4:01 PM33The feature is not available right now in the portalSalman KhanSecurity - SoftwareProblem
1207901/31/2021 4:41 PM1/31/2021 2:08 AM44While the Partner care team were very good at opening a line of communication, we still feel that the NOC are often letting us down.Ronak WaghelaPortalProblem
1353284/30/2021 10:56 AM4/28/2021 2:03 AM55 Saud AnsariHD ServiceInquiry
1548036/30/2021 12:58 PM6/30/2021 12:56 PM55 Salman KhanControlInquiry
1624118/3/2021 11:09 AM7/30/2021 8:16 PM55 Ronak WaghelaAssist Help DeskProblem
1235902/18/2021 4:14 PM2/10/2021 5:15 PM11I doubt there is anything connectwise can do to stop sucking. We really HATE that we have to deal with Connectwise as a ContinuumSalman PatelPortalInquiry
1349734/26/2021 4:03 PM4/26/2021 1:51 PM55 Salman PatelPortalInquiry
1566447/20/2021 4:22 PM7/13/2021 3:54 PM33 Ronak WaghelaPortalInquiry
1361685/5/2021 9:51 AM5/4/2021 4:57 PM44N/A - I was the last person to be assigned this. I'm sorry I cannot provide further feedback. I appreciate your support while looking into this case.Salman KhanNot Product RelatedProblem
1429586/7/2021 6:23 AM6/5/2021 6:52 AM55 Ricky ThakurFortifyInquiry
1386266/7/2021 5:46 AM5/26/2021 3:00 PM55 Ricky ThakurFortifyProblem
1218422/7/2021 3:12 PM1/29/2021 5:01 PM22please call us to validate if we are indeed aware of overdue account first. due to your upgrades and system changes, our auto pay setup was disregarded and we would normally check auto pay accounts.Sagar MorePortalProblem
 
2 ACCEPTED SOLUTIONS
AllisonKennedy
Super User
Super User

@saud968 , are you looking for the value 4 OR 5? none of the rows in your sample data are 4 && 5: 

 

Try this instead: 

 

C-SAT = CALCULATE(COUNT(CSAT), FILTER(CSAT, CSAT[CSAT] = 4 || CSAT[CSAT] 5 ))


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

@saud968  You are very welcome. && will give you an AND condition, so both values must be true. || gives you an OR condition, so the value must be 4 OR 5 in that case. 


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

7 REPLIES 7
AllisonKennedy
Super User
Super User

@saud968 , are you looking for the value 4 OR 5? none of the rows in your sample data are 4 && 5: 

 

Try this instead: 

 

C-SAT = CALCULATE(COUNT(CSAT), FILTER(CSAT, CSAT[CSAT] = 4 || CSAT[CSAT] 5 ))


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

Thank you that worked I wanted to count both 4 & 5... I saw one video where I saw the guy used && for multiple filter

@saud968  You are very welcome. && will give you an AND condition, so both values must be true. || gives you an OR condition, so the value must be 4 OR 5 in that case. 


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 I actually wanted both 4 & 5 from CSAT column weirdly || or function gave the perfect count

@saud968 I think you've inspired me to do a new blog post on AND vs OR filters, they're not intuitive. 

 

AND means that for a single row the value must be both 4 AND 5. This is never possible, the value will be 4 OR 5, can't be both in a single row, so you'll get blank.

 

OR means for the column you want to include ALL values that are equal to either 4 OR 5, so it will look for each single row and say 'does this value equal 4 OR 5?' if yes it will return that row, then it will search the next row and say 'does this value equal 4 OR 5?' if yes, it will return that row. In this manner we get all rows that equal 4 AND we get all rows that equal 5, by checking if EACH row equals 4 OR 5.  Are you confused yet? Hopefully that helps clarify a bit... 


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  I am glad I was able to do something good 😅. Yes, it is clear now and understood. I agree that you should be doing the blog for the same. 

Blog post is live: https://excelwithallison.blogspot.com/2021/09/advanced-filter-or-vs-and.html in case anyone is interested in learning more about AND OR conditions in advanced filters. I welcome your feedback!


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
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.