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
Dolfvc
Frequent Visitor

RANKX function is not working

I have a simple table from Google Analytics that look at website pageviews for a online news site.

The table (Views) consist of the following columns:
"Category" "screenPageViews" "pageTitle" "date" and "FullURL"

 

I have this function that works perfectly:

RankCat =
VAR ViewRank = RANKX(ALL(Views[Category]), CALCULATE(SUM(Views[screenPageViews])),,DESC)
RETURN
ViewRank

However this function is not working correctly:
RankArt =
VAR ViewRank = RANKX(ALL(Views[pageTitle]), CALCULATE(SUM(Views[screenPageViews])),,DESC)
RETURN
ViewRank
Dolfvc_2-1694505116697.png

 


 

Dolfvc_1-1694505065136.png

 

1 REPLY 1
isjoycewang
Super User
Super User

Hi @Dolfvc,

 

I create some dummy data for demo: Exercise File

Please consider that there is also 'Category' column in your second table.

RankArt = 
IF( HASONEVALUE(Views[Category]),
RANKX( ALL(Views[pageTitle],Views[Category]),  CALCULATE(SUM(Views[screenPageViews])),,DESC), "")

isjoycewang_0-1694512562676.png

 

 

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.

Top Solution Authors
Top Kudoed Authors