Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

RANKX & ALLSELECTED not returning expected results

Hi All,

 

I am having an issue and hope someone has the insight/expertise to help me resolve this. I am having issues with this particular measure: 

 
zSequence1ToN = RANKX(ALLSELECTED(Table8[Week Ending]),CALCULATE(MAX(Table8[Week Ending])),,ASC)

 

It is being used as part of a larger regression calculation, referenced here: Polynomial Regression for Power BI - Noah Severyn (weebly.com).

 

Per my understanding, this measure should rank the week ending values in ascending order based upon my client filter selection on the dashboard. It works as expected for Client B, however for Client A and Client C it does not work as expected:

 

tylerh_1-1660754893631.pngtylerh_2-1660754915530.png

 

tylerh_3-1660754933582.png

 

For example, for Client A I would like for the first week that client has data (May 23, 2021) to be ranked 1, with subsequent weeks ranked accordingly.

 

Does anyone have any suggestions or advice on how to rewrite to accomplish this?

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

Try:

zSequence1ToN = RANKX(ALLEXCEPT (Table8, Table8[Client]),CALCULATE(MAX(Table8[Week Ending])),,ASC)





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

1 REPLY 1
PaulDBrown
Community Champion
Community Champion

Try:

zSequence1ToN = RANKX(ALLEXCEPT (Table8, Table8[Client]),CALCULATE(MAX(Table8[Week Ending])),,ASC)





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.