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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cottrera
Post Prodigy
Post Prodigy

DAX - Monthly leader board

Hi

 

I have a table that contains the results from a customer survey , based on the engineers visit.  I need to create a monthly leader board to show the best monthtly rated engineer.

 

Facts survey table - connected to dates table

EngineerSurvey RefSurvey DateRating Out of
Engineer 1S101/01/202245
Engineer 1S202/01/202245
Engineer 1S303/01/202255
Engineer 1S404/01/202255
Engineer 1S501/02/202255
Engineer 1S602/02/202255
Engineer 1S703/02/202255
Engineer 1S804/02/202255
Engineer 2S901/01/202255
Engineer 2S1002/01/202255
Engineer 2S1103/01/202255
Engineer 2S1204/01/202255
Engineer 2S1301/02/202235
Engineer 2S1402/02/202235
Engineer 2S1503/02/202245
Engineer 2S1604/02/202255

 

Based on the small sample table above. These would be the results I would expect to see

 

Monthly Highest Rating Engineer Leader board

JanFeb
Engineer 2Engineer 1

 

Does anyone have any idears how to do this with a DAX function.

 

thank you

 

Richard

1 ACCEPTED SOLUTION
SpartaBI
Community Champion
Community Champion

@cottrera 
Create this measure:

 

Measure = 
VAR _tbl = 
ADDCOLUMNS(
    VALUES(survey[Engineer]),
    "@Total Rating", CALCULATE(SUM(survey[Rating ]))
)
VAR _max_rating = MAXX(_tbl, [@Total Rating])
VAR _top_tbl = 
    FILTER(
        _tbl,
        [@Total Rating] = _max_rating
    )
VAR _result = 
    CONCATENATEX(_top_tbl, survey[Engineer], ", ")
RETURN
    _result

 


link to file with the solution:
DAX - Monthly leader board.pbix


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

View solution in original post

3 REPLIES 3
SpartaBI
Community Champion
Community Champion

@cottrera 
Create this measure:

 

Measure = 
VAR _tbl = 
ADDCOLUMNS(
    VALUES(survey[Engineer]),
    "@Total Rating", CALCULATE(SUM(survey[Rating ]))
)
VAR _max_rating = MAXX(_tbl, [@Total Rating])
VAR _top_tbl = 
    FILTER(
        _tbl,
        [@Total Rating] = _max_rating
    )
VAR _result = 
    CONCATENATEX(_top_tbl, survey[Engineer], ", ")
RETURN
    _result

 


link to file with the solution:
DAX - Monthly leader board.pbix


2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

Thank you for the quick response 😀 Love the showcase report

@cottrera thank you my friend! Please give it a kudos 😀
*Will appreciate also kudos for my messages here 😉

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.