Forum Discussion

TheCigi9's avatar
TheCigi9
Frequent Visitor
10 years ago
Solved

Rank Visualization and rounddown

     as you see this is What I'd like to solve, today.   I'greatly appreciate your help.   Thanks  
  • v-sihou-msft's avatar
    10 years ago

    TheCigi9

     

    You can use ROUNDDOWN() Function to round down the value to 2 decimals.

     

    In my chart, when a company is selected, the highest value product in this company will be displayed in Card. Rank value of each product in this company will be displayed in Multi-row card.

     

    When a product is selected, the highest value product in this company will be displayed in Card. Rank value and value of this product in this company will be displayed in Multi-row card.

     

    Please refer to following detailed steps:

    1. Create a calculated column which stores the value rank of each product in the company.
      RankInCompany1 = 
      RANKX (
          FILTER ( Table1, EARLIER ( Table1[Selling company] ) = Table1[Selling company] ),
          Table1[Value]
      )
      
    2. Create a calculated column which stores the information displayed in Multi-row card.
      Title2 = 
      VAR RankString =
          SWITCH (
              Table1[RankInCompany1],
              1, "most expensive",
              2, "2nd",
              3, "3rd",
              Table1[RankInCompany1] & "th"
          )
      RETURN
          ( Table1[Brand name] & " is the "
              & RankString
              & " product of "
              & Table1[Selling company] & ", with a price of " & ROUNDDOWN(Table1[Value],2) & "€" )
      
    3. Create a measure which will show the most expensive product of selected company.
      MostExpensiveCar = 
      IF (
          HASONEVALUE ( Table1[Selling company] ),
          LOOKUPVALUE (
              Table1[Brand name],
              Table1[Value], CALCULATE (
                  MAX ( Table1[Value] ),
                  ALLEXCEPT ( Table1, Table1[Selling company] )
              )
          )
              & " is the highest value product in this company",
          "Please highlight a company or a product."
      )
      
    4. Drag one custom visual Hierarchy Slicer, one Multi-row card and one Card into the canvas.