cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sodared123
Frequent Visitor

How do i compute average score

Hi guys!

 

Need help on this.

Sodared123_0-1668740042627.png

I am trying to create a customer dashboard based on scoring of each customer. So when i filter to customer A for example, it will show a simple average of A score, B score and total of A and B score on card visuals. May i know what kind of measures or dax will make it possible?

Thanks!

1 ACCEPTED SOLUTION
v-binbinyu-msft
Community Support
Community Support

Hi @Sodared123 ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1669010254576.png

2. create three measure with below dax formula

Avg for A Score =
VAR cur_ct =
    SELECTEDVALUE ( 'Table'[Customer] )
VAR tmp =
    FILTER ( ALL ( 'Table' ), 'Table'[Customer] = cur_ct )
RETURN
    AVERAGEX ( tmp, [A Score] )
Avg for B Score =
VAR cur_ct =
    SELECTEDVALUE ( 'Table'[Customer] )
VAR tmp =
    FILTER ( ALL ( 'Table' ), 'Table'[Customer] = cur_ct )
RETURN
    AVERAGEX ( tmp, [B Score] )
Avg Score for Total = [Avg for A Score]+[Avg for B Score]

3. add a slicer with "Table[Customer]" column, add three card visual with above measure, add a table visual with fields

Animation17.gif

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-binbinyu-msft
Community Support
Community Support

Hi @Sodared123 ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1669010254576.png

2. create three measure with below dax formula

Avg for A Score =
VAR cur_ct =
    SELECTEDVALUE ( 'Table'[Customer] )
VAR tmp =
    FILTER ( ALL ( 'Table' ), 'Table'[Customer] = cur_ct )
RETURN
    AVERAGEX ( tmp, [A Score] )
Avg for B Score =
VAR cur_ct =
    SELECTEDVALUE ( 'Table'[Customer] )
VAR tmp =
    FILTER ( ALL ( 'Table' ), 'Table'[Customer] = cur_ct )
RETURN
    AVERAGEX ( tmp, [B Score] )
Avg Score for Total = [Avg for A Score]+[Avg for B Score]

3. add a slicer with "Table[Customer]" column, add three card visual with above measure, add a table visual with fields

Animation17.gif

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Sodared123
Frequent Visitor

Hello guys! Any kind souls?

Sodared123
Frequent Visitor

Hi Amit

 

Not sure if you get my requirements right, based on below table date, if i filter for customer A, i will see 1.75 (average of 1.5 and 2) in A score card, 2.15 (based on average of 2.1 and 2.2) in B score card, and 3.9 in the total score card. In this case, how many measures should i be creating and what will the DAX look like? Thanks alot!

 

CustomerInvoice NumberA ScoreB Score

A

12341.5 
A2234 2.1
A33451.6 
A12552 
B13541.2 
B1288 2.5
C13443 
C1412 1.1
C11111.2 

 

 

 

amitchandak
Super User
Super User

@Sodared123 , Try like

 

Averagex(Summarize(Table, Table[Customer], Table[Invoice Number]), calculate(Sum(Table[A Score]) + Sum(Table[A Score]) ) )

 

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Top Solution Authors