Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Calculate avg CSAT

Hello Experts,

 

I am trying to derive "Average CSAT per skill" from below two tables using DAX. 

 

Table 1
DATESKILL
1/02/2020Skill 2
1/02/2020Skill 3
1/02/2020Skill 1
2/02/2020Skill 2
2/02/2020Skill 3
2/02/2020Skill 1
3/02/2020Skill 2
3/02/2020Skill 3
3/02/2020Skill 1
4/02/2020Skill 2
4/02/2020Skill 3
4/02/2020Skill 1
5/02/2020Skill 2
5/02/2020Skill 3
5/02/2020Skill 1

 

Table 2
DateSkill NameType
3/02/2020Skill 2CSAT
3/02/2020Skill 2CSAT
3/02/2020Skill 2CSAT
3/02/2020Skill 2CSAT
3/02/2020Skill 2CSAT
3/02/2020Skill 3CSAT
3/02/2020Skill 3CSAT
3/02/2020Skill 3CSAT
3/02/2020Skill 3CSAT
3/02/2020Skill 3CSAT
3/02/2020Skill 1CSAT
3/02/2020Skill 1CSAT
3/02/2020Skill 1CSAT
3/02/2020Skill 1CSAT
3/02/2020Skill 1CSAT
2/02/2020Skill 2CSAT
2/02/2020Skill 2CSAT
2/02/2020Skill 2CSAT
2/02/2020Skill 2CSAT
2/02/2020Skill 2CSAT
2/02/2020Skill 3CSAT
9/02/2020Skill 2Alternate contact
9/02/2020Skill 2Alternate contact
9/02/2020Skill 2Alternate contact
9/02/2020Skill 2Alternate contact
9/02/2020Skill 2Alternate contact
10/02/2020Skill 3Open feedback
11/02/2020Skill 3Open feedback
11/02/2020Skill 3Open feedback
12/02/2020Skill 1Open feedback
12/02/2020Skill 1Open feedback
12/02/2020Skill 1Open feedback

 

The CSAT is weighted as follows :-

Score 5 = 1, Score 4 = 0.75, Score 3 = 0.5, Score 2 = 0.25, Score 1 = 0 

 

The idea is to derive CSAT is looking at if the responses are as per below;

 

1 – 5 (5*0) = 0

2 – 1 (1*0.25) = 0.25

3 – 2 (2*0.5) = 1

4 – 13 (13*0.75) = 9.75

5 – 79 (79*1) = 79

 

So CSAT is 90/100.

 

It would be great if you could help me with this problem. I am unable to found a correct way to derive the calculation.

 

Kind regards

 

1 ACCEPTED SOLUTION
technolog
Super User
Super User

First, you need to filter out the rows in Table 2 that are of type "CSAT". Then, you'll want to count the number of occurrences of each score for each skill. Once you have these counts, you can multiply them by their respective weights to get the weighted score for each skill. Finally, you'll sum up these weighted scores and divide by the total number of CSAT responses to get the average CSAT per skill.

Here's a DAX formula that should help you achieve this:

Average CSAT per Skill =
VAR CSATTable = FILTER(Table2, Table2[Type] = "CSAT")
VAR Score5Count = COUNTROWS(FILTER(CSATTable, CSATTable[Score] = 5))
VAR Score4Count = COUNTROWS(FILTER(CSATTable, CSATTable[Score] = 4))
VAR Score3Count = COUNTROWS(FILTER(CSATTable, CSATTable[Score] = 3))
VAR Score2Count = COUNTROWS(FILTER(CSATTable, CSATTable[Score] = 2))
VAR Score1Count = COUNTROWS(FILTER(CSATTable, CSATTable[Score] = 1))

VAR WeightedScore =
(Score5Count * 1) +
(Score4Count * 0.75) +
(Score3Count * 0.5) +
(Score2Count * 0.25) +
(Score1Count * 0)

VAR TotalCSATResponses = Score5Count + Score4Count + Score3Count + Score2Count + Score1Count

RETURN
IF(TotalCSATResponses = 0, BLANK(), WeightedScore / TotalCSATResponses)
This formula first creates a table with only the CSAT responses. It then counts the number of each score and calculates the weighted score. Finally, it divides the weighted score by the total number of CSAT responses to get the average CSAT per skill.

View solution in original post

1 REPLY 1
technolog
Super User
Super User

First, you need to filter out the rows in Table 2 that are of type "CSAT". Then, you'll want to count the number of occurrences of each score for each skill. Once you have these counts, you can multiply them by their respective weights to get the weighted score for each skill. Finally, you'll sum up these weighted scores and divide by the total number of CSAT responses to get the average CSAT per skill.

Here's a DAX formula that should help you achieve this:

Average CSAT per Skill =
VAR CSATTable = FILTER(Table2, Table2[Type] = "CSAT")
VAR Score5Count = COUNTROWS(FILTER(CSATTable, CSATTable[Score] = 5))
VAR Score4Count = COUNTROWS(FILTER(CSATTable, CSATTable[Score] = 4))
VAR Score3Count = COUNTROWS(FILTER(CSATTable, CSATTable[Score] = 3))
VAR Score2Count = COUNTROWS(FILTER(CSATTable, CSATTable[Score] = 2))
VAR Score1Count = COUNTROWS(FILTER(CSATTable, CSATTable[Score] = 1))

VAR WeightedScore =
(Score5Count * 1) +
(Score4Count * 0.75) +
(Score3Count * 0.5) +
(Score2Count * 0.25) +
(Score1Count * 0)

VAR TotalCSATResponses = Score5Count + Score4Count + Score3Count + Score2Count + Score1Count

RETURN
IF(TotalCSATResponses = 0, BLANK(), WeightedScore / TotalCSATResponses)
This formula first creates a table with only the CSAT responses. It then counts the number of each score and calculates the weighted score. Finally, it divides the weighted score by the total number of CSAT responses to get the average CSAT per skill.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.