Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

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)
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous ,

     

    Please find the pbix attached.

    https://we.tl/t-Qhts3Enm6g

     

     

    Have made some changes to the data model.

     

     

    Regards,

    Harsh Nathani

     

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

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

     

    Regards,

    Harsh Nathani

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hello, Anonymous 

      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
      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi Anonymous ,

         

        Please find the pbix attached.

        https://we.tl/t-Qhts3Enm6g

         

         

        Have made some changes to the data model.

         

         

        Regards,

        Harsh Nathani