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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
jinweitan
Frequent Visitor

Average of unique column

Hi all,

 

I have a set of data and would like to calculate the average of the unqiue

 

The raw data set is as below:

 

GUIDTypeScore
1a90
1a90
1anull
1b100
2a100
2anull
2b95
3a50
3a50
3a50

 

I would like to make it Becoming these:

 

GUIDTypeScore
1a90
2a100
3a50

 

Hence Average for Type a is (90+100+50)/3 = 46.67

 

and for Type b

GUIDTypeScore
1b100
2b95

 

The average is (100+95)/2 = 97.5

 

I've tried a few measures but it seems to take account for the duplication including

 

Measure = AVERAGEX
(SUMMARIZE ('Table 1'[GUID]), CALCULATE(AVERAGE('Table 1'[Score])))
 
Thanks a lot
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @jinweitan ,

 

Based on my test, it is suggested to create a calculated table.

Table 2 =
DISTINCT (
    SELECTCOLUMNS (
        'Table',
        "GUID", [GUID],
        "Type", [Type],
        "Score",
            CALCULATE (
                MAX ( 'Table'[Score] ),
                ALLEXCEPT ( 'Table', 'Table'[GUID], 'Table'[Type] )
            )
    )
)

18.png

 

Create a measure.

MaxScore =
IF (
    HASONEVALUE ( 'Table 2'[GUID] ),
    SUM ( 'Table 2'[Score] ),
    AVERAGE ( 'Table 2'[Score] )
)

 

The result is this. Change the name of Total to Average.

1.png

 

You can check more details from here.

 

 

 

Best Regards,

Stephen Tao

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @jinweitan ,

 

Based on my test, it is suggested to create a calculated table.

Table 2 =
DISTINCT (
    SELECTCOLUMNS (
        'Table',
        "GUID", [GUID],
        "Type", [Type],
        "Score",
            CALCULATE (
                MAX ( 'Table'[Score] ),
                ALLEXCEPT ( 'Table', 'Table'[GUID], 'Table'[Type] )
            )
    )
)

18.png

 

Create a measure.

MaxScore =
IF (
    HASONEVALUE ( 'Table 2'[GUID] ),
    SUM ( 'Table 2'[Score] ),
    AVERAGE ( 'Table 2'[Score] )
)

 

The result is this. Change the name of Total to Average.

1.png

 

You can check more details from here.

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@jinweitan , Try like

Measure = AVERAGEX(SUMMARIZE ('Table 1'[GUID],'Table 1'[Score]),[score])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors