Change Category Value by Rank Number

  • Change Category Value by Rank Number

    Posted by DSC Communities on April 13, 2020 at 12:58 pm
    • Paul Stevens

      Member

      April 13, 2020 at 12:58 PM

      Hi,Ā 

      Just new to this forum so bear with me please. Reasonably new to PBI but have a good grasp of the basics.Ā 

      I was just wondering if anyone knows of a way to reassign a category name based on whether it sits in the top 3 of the category rank order.Ā 

      For example if I haveĀ 

      Animal Ā  Ā  Ā  Ā  Count of Animal Ā  Ā Ā  Rank
      Dog Ā  Ā  Ā  Ā  Ā  Ā  10 Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā Ā  1
      Cat Ā  Ā  Ā  Ā  Ā  Ā Ā  8 Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā Ā  2
      Rabbit Ā  Ā  Ā  Ā  7 Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā Ā  3
      Cow Ā  Ā  Ā  Ā  Ā Ā  4 Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā Ā  4
      Horse Ā  Ā  Ā  Ā Ā  2 Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā Ā  5

      Is there anyway to show it as ……..(aggregate everything > 3 rankĀ  as “Other”)Ā 

      Animal Ā  Ā  Ā  Ā  Count of Animal Ā  Ā Ā  Rank
      Dog Ā  Ā  Ā  Ā  Ā  Ā  10 Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā Ā  1
      Cat Ā  Ā  Ā  Ā  Ā  Ā Ā  8 Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā Ā  2
      Rabbit Ā  Ā  Ā  Ā  7 Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā Ā  3
      Other Ā  Ā  Ā  Ā Ā  6 Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  N/A

      I need this to be dynamic so when filters are applied (ie change Category = Animal to Category = Type of Fish) the Rank is reassigned based on the count (and “Other” category assigned accordingly.)Ā 

      Any thoughts / suggestions would be greatly received.Ā 

      Thanks in AdvanceĀ 

      ——————————
      P
      ——————————

    • Ashley Hsia

      Member

      April 13, 2020 at 5:18 PM

      ?You would need a calculated column.Ā 

      Top3= IF(RANKX(YourTable,YourTable[Count of Animal])<=3,YourTable[Animal],”Other”)

      If you are using the built-in counting function you may need a counting column before this will work.Ā 

      Best wishes,

      ——————————
      AHsia
      ——————————
      ——————————————-

    • SĆøren Amstrup

      Member

      April 14, 2020 at 2:39 AM

      Maybe you can find some inspiration here:
      Top 10 / Otherhttps://community.powerbi.com/t5/Desktop/Top-10-Other/m-p/52120
      https://blog.gbrueckl.at/2019/05/power-bi-dynamic-topn-others-with-drill-down/

      ——————————
      SĆøren Amstrup
      Consultant
      30858032
      ——————————
      ——————————————-

    DSC Communities replied 5 years, 5 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Change Category Value by Rank Number’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!