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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Need your help to calculate average value based on the distinct count & date

Hi,

 

I'm looking for your help to create the measure for the below table

 

DateBadgeTotal
31/08/2021A95.5
31/08/2021A98.2
30/08/2021B91.2
31/08/2021B93.3
31/08/2021B96.4
30/08/2021C95.5
30/08/2021D98.2
30/08/2021E91.2
28/08/2021F93.3
29/08/2021F96.4

 

I want to calculate the count of distinct badges based on the below conditions average value. 

      a) Distinct count of badge based on Average value above 90

      b) Distinct count of badge based on Average value between 90 to 75

      c) Distinct count of badge based on Average value below 75

 

I'm going to use the "Date" as a slicer. if I'm I select a particular date from the slicer, it shows the distinct count of badges based on the average value condition.

For example, the output for 31/08/2021 is 

           1) > 90 =  2

           2)  90 -75 = 1

            3) < 75 =  1

 

 

 

 

1 ACCEPTED SOLUTION
Jos_Woolley
Solution Sage
Solution Sage

Hi Sakthi,

Thanks for clarifying.

Measure1 =
VAR MyTable =
    SUMMARIZE (
        'Table',
        'Table'[Badge],
        "Average Score", AVERAGE ( 'Table'[Total] )
    )
RETURN
    SUMX ( MyTable, 0 + ( [Average Score] > 90 ) )
Measure2 =
VAR MyTable =
    SUMMARIZE (
        'Table',
        'Table'[Badge],
        "Average Score", AVERAGE ( 'Table'[Total] )
    )
RETURN
    SUMX ( MyTable, ( [Average Score] >= 75 ) * ( [Average Score] <= 90 ) )
Measure3 =
VAR MyTable =
    SUMMARIZE (
        'Table',
        'Table'[Badge],
        "Average Score", AVERAGE ( 'Table'[Total] )
    )
RETURN
    SUMX ( MyTable, 0 + ( [Average Score] < 75 ) )

Regards

View solution in original post

5 REPLIES 5
Jos_Woolley
Solution Sage
Solution Sage

Glad to know! Cheers.

Jos_Woolley
Solution Sage
Solution Sage

Hi Sakthi,

Thanks for clarifying.

Measure1 =
VAR MyTable =
    SUMMARIZE (
        'Table',
        'Table'[Badge],
        "Average Score", AVERAGE ( 'Table'[Total] )
    )
RETURN
    SUMX ( MyTable, 0 + ( [Average Score] > 90 ) )
Measure2 =
VAR MyTable =
    SUMMARIZE (
        'Table',
        'Table'[Badge],
        "Average Score", AVERAGE ( 'Table'[Total] )
    )
RETURN
    SUMX ( MyTable, ( [Average Score] >= 75 ) * ( [Average Score] <= 90 ) )
Measure3 =
VAR MyTable =
    SUMMARIZE (
        'Table',
        'Table'[Badge],
        "Average Score", AVERAGE ( 'Table'[Total] )
    )
RETURN
    SUMX ( MyTable, 0 + ( [Average Score] < 75 ) )

Regards

Anonymous
Not applicable

Thank you Jos.. Really it is working perfectly. 

Jos_Woolley
Solution Sage
Solution Sage

Hi,

Can you clarify? Your posted data only has values greater than 90, so I'm confused as to how you could ever arrive at an average less than 90 from that dataset.

Regards

Anonymous
Not applicable

Hi Jos, 

 

Sorry for the confusion. please find below the corrected dataset.

DateBadgeTotal
31/08/2021A95.5
31/08/2021A98.2
30/08/2021B91.2
31/08/2021B93.3
31/08/2021B96.4
31/08/2021C80.2
31/08/2021C85.2
30/08/2021D98.2
30/08/2021E91.2
28/08/2021F93.3
31/08/2021F74.2

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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