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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
shikhar6339
New Member

Calculate Highest scorer along with name

Hi All,

 

I have the below data and I need to create 4 measures:

1) Measure to display who has the highest total points scored in a given year. (to be displayed in card)

2) What was the highest total points scored. (to be displayed in card)

3) What was the average of points scored by that person (to be put in matrix)

4) count of total points scored mored than 100 (to be put in matrix)

 

YearNamePoints
2010ABC32
2010XYZ31
2010ABC43
2010XYZ53
2010XYZ64
2010ABC23
2010RST54
2010ABC76
2010XYZ53
2010RST23
2011ABC76
2011XYZ76
2011ABC45
2011RST35
2011ABC76
2011ABC43
2011XYZ87
2011RST97
2011ABC67
2011RST55
2012XYZ86
2012XYZ53
2012ABC87
2012ABC24
2012ABC87
2012XYZ54
2012ABC9
2012RST45
2012RST52
2012RST12

 

Please let me know if any additional information is required.

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

Hi @shikhar6339 ,

 

Please create a new table first.

 

Table2 = 
SUMMARIZE (
    'Table',
    'Table'[Year],
    'Table'[Name],
    "Total points", SUM ( 'Table'[Points] ),
    "Average of points", AVERAGE ( 'Table'[Points] )
)

 

vcgaomsft_1-1645430279914.png

Then create these measures.

 

Who has the highest total score = 
TOPN (
    1,
    ALL ( 'Table2'[Name] ),
    CALCULATE ( MAX ( 'Table2'[total points] ) ), 0
)
The highest total points scored =
CALCULATE ( MAX ( 'Table2'[Total Points] ) )
The average of points =
CALCULATE ( MAX ( 'Table2'[average of points] ) )
Times greater than 100 =
CALCULATE (
    COUNT ( 'Table2'[Total Points] ),
    FILTER ( 'Table2', 'Table2'[Total Points] > 100 )
)

 

Put these measures into the visual. The result should be like this.

vcgaomsft_0-1645430203456.png

Attach the pbix file for reference. Hope it helps.

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

View solution in original post

3 REPLIES 3
v-cgao-msft
Community Support
Community Support

Hi @shikhar6339 ,

 

Please create a new table first.

 

Table2 = 
SUMMARIZE (
    'Table',
    'Table'[Year],
    'Table'[Name],
    "Total points", SUM ( 'Table'[Points] ),
    "Average of points", AVERAGE ( 'Table'[Points] )
)

 

vcgaomsft_1-1645430279914.png

Then create these measures.

 

Who has the highest total score = 
TOPN (
    1,
    ALL ( 'Table2'[Name] ),
    CALCULATE ( MAX ( 'Table2'[total points] ) ), 0
)
The highest total points scored =
CALCULATE ( MAX ( 'Table2'[Total Points] ) )
The average of points =
CALCULATE ( MAX ( 'Table2'[average of points] ) )
Times greater than 100 =
CALCULATE (
    COUNT ( 'Table2'[Total Points] ),
    FILTER ( 'Table2', 'Table2'[Total Points] > 100 )
)

 

Put these measures into the visual. The result should be like this.

vcgaomsft_0-1645430203456.png

Attach the pbix file for reference. Hope it helps.

Best Regards,
Community Support Team_Gao

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.  I cannot understand your last question.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Greg_Deckler
Super User
Super User

@shikhar6339 Try:

Highest Points = 
  VAR __Year = MAX('Table'[Year])
RETURN
  MAXX(SUMMARIZE(FILTER('Table',[Year]=__Year),[Year],[Name],"__Points",SUM('Table'[Points])),[__Points])

Highest Person = 
  MAXX(TOPN(1, SUMMARIZE(FILTER('Table',[Year]=__Year),[Year],[Name],"__Points",SUM('Table'[Points])), [__Points]),[Name])

Average = 
  AVERAGEX(FILTER('Table',[Year]=__Year && [Name] = [Highest Person]),[__Points])

@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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