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 am still somewhat new to Power BI. I have a situation where I need to show the top N (in this case N is 5) records based upon the following:
1) Sorting of PassRate
2) After PassRate is sorted, then take the Top 5 records where RecNum are the largest.
Additionally, the PassRate is a Measure dividing the total records completed / total records attempted. This needs to be precise so 99.99 should show 99.9 not 100.0. I used a format command around the measure calculation from the two rows; however, that is text so when I tried to do anything with that it failed because of the data type. I tried to create a new column and put the calcualtion in and I believe it may have worked; however, when I put it in the visual it is a sum of and not the decimal number as seen in the data table.
Thanks
Thank you for your reply. I mocked up some data since I cannot share the actual items.
The table below shows 12 different students. Transferring my scenarios to sample data, the requirements are as follows:
1) Calculate the Performance Percentage to 1 decimal point (do not round so if 99.9 do not round to 100.0)
2) Provide the Top N (N= 5) student IDs for those that have the worst performance based the percentage (column B) weighted by the Total Assignments Failed (Column D).
If we go only off performance percentage we get student 005, 001, 002, 004 and 003 (the first 5 listed); however, we want those that attempted and failed more students 002, 003, 008,006, and 007.
Performance Percent | Total Assignments Passed | Total Assignments Failed | Total Assignments | |
Student 005 | 50.00 | 1 | 1 | 2 |
Student 001 | 70.00 | 70 | 30 | 100 |
Student 002 | 70.00 | 35000 | 15000 | 50000 |
Student 004 | 81.25 | 650 | 150 | 800 |
Student 003 | 90.00 | 225000 | 25000 | 250000 |
Student 008 | 91.50 | 32217 | 2994 | 35211 |
Student 006 | 91.50 | 7320000 | 680000 | 8000000 |
Student 007 | 95.00 | 243837 | 12833 | 256670 |
Student 009 | 99.99 | 25666 | 2 | 25666 |
Student 010 | 100.00 | 34538 | 0 | 34538 |
Student 011 | 100.00 | 909866 | 0 | 909866 |
Student 012 | 100.00 | 12223334 | 0 | 12223334 |
@Krc721
Thank you for your explanation and it will be helpful if you could provide some sample data and the expected results so that I'll be able to workout a solution. You can copy paste from your sample data from an excel in your reply or attach a Excel file after saving it in Google drive or onedrive
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Update, tried some DAX, something is still off:
Scores is the database in sample
All (takes off the filter - although I do need to filter NaNs out - not in my sample but in real data set).
The numbering begins at 2 not 1 (not sure why)
And the sort is accurate for the first column (sorts the Performance Percent in proper ascending order; however, the column for pass (the weighting column) is not sorting.
@Fowmy I posted a reply, i think it went to the main thread on my post. Thank you for your response. If you have questions let me know.