Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Rankx overrides Filter

Hello, all,

I am looking at housing data. I want to view the top zip codes by median days on the market in a state. My chart works fine until I introduce the ranking. I have a page filter for california and the chart only returns california zipcodes and their median days on the market. When I add my rankx measure every zip code from the source data is added to the chart non California zip codes return a blank value for median days on and a ranking of 1. Below is the rankx measure I created. Any help would be appreciated, Thanks!

Days_on_Rank = Rankx(
ALLSELECTED(Table_1[Full Zip Code]),
CALCULATE(SUM(Table_2[median_days_on_market])),,1)
1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Please find the pbix attached.

https://we.tl/t-Qhts3Enm6g

 

 

Have made some changes to the data model.

 

 

Regards,

Harsh Nathani

 

View solution in original post

4 REPLIES 4
harshnathani
Community Champion
Community Champion

Hi @Anonymous ,

 

Can you please share some sample data and expected output to help you better with the issue.

 

Regards,

Harsh Nathani

Anonymous
Not applicable

Hello, @harshnathani 

The data I am using looks similar to the tables below. I have a table on housing data and a geography table. The visualization is just a chart. with the columns Full zip code, median days on market, and the ranking measure. The filters on the visual are Month, Year, and State which is drawing from the Geography table. I am trying to use the ranking measurement as a filter to only display the top ten zipcodes.

NOTE:
I made a mistake when typing my measure in the original post it actually pulls from only one table. Here is what the measure actually is: 

Days_on_Rank = Rankx(
ALLSELECTED(Table_One),
CALCULATE(SUM(Table_One[median_days_on_market])),,1)


------------------------------------------------------------------------------------------------------------------------------------------------
Data Table:

Full zip CodeMedian days on marketMonthYear
9000123032020
9000230032020


------------------------------------------------------------------------------------------------------------------------------------------------
Geography Table:

 

Full Zip codeState
90001CA
90002CA

 

------------------------------------------------------------------------------------------------------------------------------------------------
Expected Output:

 

Full Zip codeMedian days on marketRank
90242141
91942152
92116163


------------------------------------------------------------------------------------------------------------------------------------------------
Actual Output:

Full Zip codeMedian days on marketRank
0100163.51
0100230.51
0100749.1

Hi @Anonymous ,

 

Please find the pbix attached.

https://we.tl/t-Qhts3Enm6g

 

 

Have made some changes to the data model.

 

 

Regards,

Harsh Nathani

 

Anonymous
Not applicable

thanks

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.