The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I have the below table and I am trying to rank the artists by count of year, and then show the the artist with the highest count by year. How can this be achieved in DAX? I have tried looking up how to RANK by COUNT but the solutions seemed a little convoluted for this.
Artist | Year |
Artist_1| | 2012 |
Artist_1| | 2012 |
Artist_1| | 2012 |
Artist_2| | 2012 |
Artist_2| | 2012 |
Artist_2| | 2012 |
Artist_2| | 2012 |
Artist_3| | 2012 |
Artist_2| | 2013 |
Artist_2| | 2013 |
Artist_2| | 2013 |
Artist_4| | 2013 |
Artist_4| | 2013 |
Artist_4| | 2013 |
Artist_4| | 2013 |
Artist_1| | 2013 |
The result I am looking for is:
Year | Artist |
2012| | Artist_2 |
2013| | Artist_4 |
I have calculated count of the year against the artist and sorted it to show the top first two artists as per your requirement.
How can I filter/remove the rest of the results?