Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello Experts,
I am trying to derive "Average CSAT per skill" from below two tables using DAX.
Table 1 | |
DATE | SKILL |
1/02/2020 | Skill 2 |
1/02/2020 | Skill 3 |
1/02/2020 | Skill 1 |
2/02/2020 | Skill 2 |
2/02/2020 | Skill 3 |
2/02/2020 | Skill 1 |
3/02/2020 | Skill 2 |
3/02/2020 | Skill 3 |
3/02/2020 | Skill 1 |
4/02/2020 | Skill 2 |
4/02/2020 | Skill 3 |
4/02/2020 | Skill 1 |
5/02/2020 | Skill 2 |
5/02/2020 | Skill 3 |
5/02/2020 | Skill 1 |
Table 2 | ||
Date | Skill Name | Type |
3/02/2020 | Skill 2 | CSAT |
3/02/2020 | Skill 2 | CSAT |
3/02/2020 | Skill 2 | CSAT |
3/02/2020 | Skill 2 | CSAT |
3/02/2020 | Skill 2 | CSAT |
3/02/2020 | Skill 3 | CSAT |
3/02/2020 | Skill 3 | CSAT |
3/02/2020 | Skill 3 | CSAT |
3/02/2020 | Skill 3 | CSAT |
3/02/2020 | Skill 3 | CSAT |
3/02/2020 | Skill 1 | CSAT |
3/02/2020 | Skill 1 | CSAT |
3/02/2020 | Skill 1 | CSAT |
3/02/2020 | Skill 1 | CSAT |
3/02/2020 | Skill 1 | CSAT |
2/02/2020 | Skill 2 | CSAT |
2/02/2020 | Skill 2 | CSAT |
2/02/2020 | Skill 2 | CSAT |
2/02/2020 | Skill 2 | CSAT |
2/02/2020 | Skill 2 | CSAT |
2/02/2020 | Skill 3 | CSAT |
9/02/2020 | Skill 2 | Alternate contact |
9/02/2020 | Skill 2 | Alternate contact |
9/02/2020 | Skill 2 | Alternate contact |
9/02/2020 | Skill 2 | Alternate contact |
9/02/2020 | Skill 2 | Alternate contact |
10/02/2020 | Skill 3 | Open feedback |
11/02/2020 | Skill 3 | Open feedback |
11/02/2020 | Skill 3 | Open feedback |
12/02/2020 | Skill 1 | Open feedback |
12/02/2020 | Skill 1 | Open feedback |
12/02/2020 | Skill 1 | Open 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
Solved! Go to Solution.
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.
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.
User | Count |
---|---|
15 | |
9 | |
8 | |
6 | |
5 |
User | Count |
---|---|
31 | |
18 | |
13 | |
7 | |
5 |