Forum Discussion
#1 HELP_DAX RANKX Function Strange issue
- 8 years ago
HI _google
Try adding these two calculated columns to your table
Rank of Product = CALCULATE( COUNTROWS('fUnits') , FILTER( ALL(fUnits) , 'fUnits'[Profit] > EARLIER('fUnits'[Profit]) ) ) +1Rank of Product by Manufacturer = CALCULATE( COUNTROWS('fUnits') , FILTER( ALL(fUnits) , 'fUnits'[Manufacturer] = EARLIER('fUnits'[Manufacturer]) && 'fUnits'[Profit] > EARLIER('fUnits'[Profit]) ) ) +1 - 8 years ago
Hi _google
Did you add these as calculated columns?
Here is a link to a simplified version of the PBIX file with both calculated columns added.
https://1drv.ms/u/s!AtDlC2rep7a-oirt55D4GDKunVSc
- 8 years ago
Hi,
You may download my solution from here. This has been done in MS Excel using the PowerPivot but can also be done in PowerBI desktop. You may also import all the data and the formulas from this Excel file directly into PowerBI desktop by going to File > Import in PowerBI desktop.
Hope this helps.
- 8 years ago
Hi Phil
Thanks for the solution, it work with calculated column, I was trying to do it through a measure however it helps on learning curve with DAX
regards
Hi,
You may download my solution from here. This has been done in MS Excel using the PowerPivot but can also be done in PowerBI desktop. You may also import all the data and the formulas from this Excel file directly into PowerBI desktop by going to File > Import in PowerBI desktop.
Hope this helps.
Hi Ashish,
Thanks for the solution, it works great. As am new to DAX, may i check logical view on using nested RANKX.
regards
- Ashish_Mathur8 years agoSuper User
You are welcome.