Forum Discussion
Top N nested
- 6 years ago
Hi, Anonymous
Based on your description, there are three ways o achieve your requirement.
Way1:
You may create a calculated column as follows.
RankColumn = COUNTROWS( FILTER( 'Table', 'Table'[Division] = EARLIER('Table'[Division])&& 'Table'[SOH] > EARLIER('Table'[SOH]) ) )+1Result:
Way2:
You may create a measure as below.
RankMeasure = RANKX( ALLSELECTED('Table'[Product]), CALCULATE(SUM('Table'[SOH])), , DESC, Dense )Result:
Way3:
You may create a calculated table as follows.
Table 3 = SUMMARIZE( 'Table', 'Table'[Product], 'Table'[Division], 'Table'[SOH], "rank", var _currentdivision = MAX('Table'[Division]) var _currentsoh = MAX('Table'[SOH]) return COUNTROWS( FILTER( ALL('Table'), 'Table'[Division] = _currentdivision&& 'Table'[SOH] > _currentsoh ) )+1 )Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Please this article
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
RANKX(all('Item'[Product]),[SOH],,DESC,Dense)
RANKX(all('Item'[Product]),calculate(sum([SOH])),,DESC,Dense)
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin