March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
86 | |
76 | |
57 | |
52 |
User | Count |
---|---|
201 | |
137 | |
108 | |
73 | |
68 |