cancel
Showing results for
Did you mean:
Helper III

## How to get ranks based on power BI report views

Hi,

Im trying to get ranks based on the views count on reports in workspaces.I tried so many ways and can someone help me to get the ranks based on the view count.I got views,

viewS = IF(Usage[Activity]="ViewReport"|| Usage[Activity]="ViewDashboard",1,0)
View count=
CALCULATE(COUNT(Usage[viewS]))
I want to get ranks based on the view count. Can someone correct me if my view count KPI is wrong? and also help me to get the ranks.
Thanks

1 ACCEPTED SOLUTION
Community Support

Hi @Mishelle ，

First, please update the formula of your measure [View count] as below:

 View count= CALCULATE(SUM(Usage[viewS]))

Then create a measure as below:

``Rank = IF([View count]=0,BLANK(),RANKX(ALLSELECTED('Usage'[Activity]),[View count],,DESC,Dense))​``

If the above one is not what you want, please provide some sample and your expected result with sample or screenshot. Thank you.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Community Support

Hi @Mishelle ，

First, please update the formula of your measure [View count] as below:

 View count= CALCULATE(SUM(Usage[viewS]))

Then create a measure as below:

``Rank = IF([View count]=0,BLANK(),RANKX(ALLSELECTED('Usage'[Activity]),[View count],,DESC,Dense))​``

If the above one is not what you want, please provide some sample and your expected result with sample or screenshot. Thank you.

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User IV

@Mishelle , First you have return blank, as 0 will also count 1

viewS = IF(Usage[Activity]="ViewReport"|| Usage[Activity]="ViewDashboard",1,blank)

This should count correct  now

View count=
CALCULATE(COUNT(Usage[viewS]))

for rank

rankx(Allselected(Usage), [View count])

or refer

For Rank Refer to these links

Proud to be a Super User!

Announcements