Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
I have a dataset that has Month number, CINUM, and a Count. I want to rank the CINUM's by count by month. So if Utilive has the highest count, then it is ranked 1 for that month. Each month, the count starts over. I would like this to be done in a calculated column if possible. If not, a measure will work.
Column = RANKX(FILTER(ALL('Table'),[Month]=EARLIER([Month])),[Count])
CINUM Rank = rankx(filter(all('CI Grouped'),[Month]= earlier([Month])),[Sum Count])
I get the error : earlier refers to an earlier row context which doesn't exist.
Hi @joshcomputer1,
What is [Sum Count]? Measure or calculated column?
In addition, could you please share your desired output so that we could understand your requirement better and get the solution?
Best Regards,
Cherry
sum count is a measure. The desired output is another column that has the rank of the CINUM SCRUB for that month.
Hi @joshcomputer1,
Is the image in your first post the original data?
Could you please share your expected output look like?
Best Regards,
Cherry
The rank column is what we are trying to solve. It is the rank based on the count of that CINUM for the month.
@joshcomputer1 I just did what @Greg_Deckler provided and it worked fine. Are you adding rank as column not measure?
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
I got the earlier error listed above when adding rankx in the data view as a calc'ed column. I would prefer a column. When I tried this was rankx as a measure, I do not get an error, but all CINUM SCRUBs are a value of 1.
@joshcomputer1share your DAX expression you are using to add rank.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.