Forum Discussion

shei7141's avatar
shei7141
Helper III
5 years ago
Solved

conditional multiply

Hi all,

 

I have a table which looks like the following

 

UniqueIDSubTotalOriginalDisNewDisNewRate
11a50010%20%Total x NewDis per Unique ID
11b 50%40% 
11c 40%40% 
22a100100%100% 

 

How can I calculate the NewRate column using dax?

 

Thanks in advance

  • parry2k's avatar
    parry2k
    5 years ago

    shei7141 here is the formula, add new column

     

    New Col = CALCULATE ( MAX ( 'Table'[Total] ), ALLEXCEPT ( 'Table', 'Table'[UniqueID] ) ) * 'Table'[NewDis] 

     

    I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

    Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

22 Replies

  • shei7141 , what is expected output. Are these all column.

    One solution can be a new column - but I doubt you need that

    new column = [Total]*[NewDis]

    • shei7141's avatar
      shei7141
      Helper III

      Thanks heaps

       

      I want to calculate this as a measure and expecting the return value to be (Total x new Dist)

      • shei7141's avatar
        shei7141
        Helper III

        also - my apologies, I forgot to mention, for each unique ID, the total value is only mentioned once and in the sub catergory the total is left blank

         
  • Anonymous's avatar
    Anonymous
    Not applicable

    Hey shei7141 

     

    Try the following. Please let me know if it works.

     

     

    -JD

     

    • shei7141's avatar
      shei7141
      Helper III

      Thanks J

      sorry mate,

      it does not recoganises any columns and I was expecting the followings results 

       

      • parry2k's avatar
        parry2k
        Super User

        shei7141 you replies are very confusing, in the last reply you inked the values which were already possible from my first solution. kind of confusing what you actually want

  • Anonymous's avatar
    Anonymous
    Not applicable

    HI shei7141 

     

    Form the limited information you have provided.

    Here is what I would do.

    NewRate = CALCULATE(SUM([TOTAL]*[NEWDIS]), ALLEXCEPT(TABLE,TABLE[UNIQUEID]))

    and use this two columns in a matrix chart.