Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello everyone,
I am pretty new to PowerBI and have a question.
I want to do something rather simple but I am lacking the syntax to do it. I constantly produce errors or wrong results, which is why I am trying my luck on here.
A simplified version of what I want to do is this:
I have column A and B in my data set and I want to calculate column C and D in the data model:
I know that I have to use "calculate" and "countrows" and "filter" and "rank" but I just can't figure out how to solve this. Please note that I can't use absolute values for neither product nor category, because I have 539 distinct products in 259 distinct categories.
Any input is very much appreciated.
Solved! Go to Solution.
Try out these two columns:
Count =
VAR __table = FILTER(ALL('Table7'),[A] = EARLIER([A]) && [B] = EARLIER([B]))
RETURN
COUNTX(__table,[B])
Rank = RANKX(FILTER(ALL('Table7'),[B] = EARLIER([B])),[Count],,DESC,Dense)
See Table7 of attached.
Try out these two columns:
Count =
VAR __table = FILTER(ALL('Table7'),[A] = EARLIER([A]) && [B] = EARLIER([B]))
RETURN
COUNTX(__table,[B])
Rank = RANKX(FILTER(ALL('Table7'),[B] = EARLIER([B])),[Count],,DESC,Dense)
See Table7 of attached.
Works as intended. Thank you very much.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.