0
votes

I have one table named survey that contains rating numbers. I want to group these numbers based on certain conditions. For this, I have created another table named SupportTable. Based on the min and max from this table I want to group the rating. For this, I tried the following code but didn't get the desired result. I want to get the result in measure( Numbers Per Group). What I am doing wrong here?

Total number of feedback = COUNTROWS(Survey) #counts no of rows in survey table Numbers Per Group = CALCULATE([Total number of feedback], FILTER(VALUES(Survey[Rating]), COUNTROWs( FILTER('SupportTable', Survey[Rating]>= 'SupportTable'[Min] && Survey[Rating]< 'SupportTable'[Max]))>0))

https://i.stack.imgur.com/NVro6.jpg

1

1 Answers

0
votes

I would suggest not to create a separate table. Use SWITCH() and create a column that tells whether the rating is Poor, Average or Excellent. Then just do the count of the new column.

Step 1 : Using SWITCH() to create a new column.

Name = SWITCH(True(),AND(Survey[Rating]>=0,Survey[Rating]<=4),"Poor"
                    ,AND(Survey[Rating]>=4,Survey[Rating]<=7),"Average"
                    ,"Excellent")

enter image description here

Step 2 : Just select the newly created column(Name) and do count.

enter image description here