cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mishelle
Helper III
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
yingyinr
Community Support
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))​

How to get ranks based on power BI report views.JPG

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.

View solution in original post

2 REPLIES 2
yingyinr
Community Support
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))​

How to get ranks based on power BI report views.JPG

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.

View solution in original post

amitchandak
Super User IV
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
https://radacad.com/how-to-use-rankx-in-dax-part-2-of-3-calculated-measures
My Video : https://www.youtube.com/watch?v=DZb_6j6WuZ0



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors