Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

divide in row

i want to divide this by each other to give the % but i have been finding it difficult

i want to divide this by each other to give the % but i have been finding it difficult

  • Anonymous ,

     

    In query editor, create an index from 1, then create a calculate column using dax below:

    Result = 
    VAR Current_Index = 'Table'[Index]
    VAR Current_Value = 'Table'[value]
    RETURN
    IF(MOD(Current_Index, 2) <> 0,  Current_Value / CALCULATE(MAX('Table'[value]), FILTER('Table', 'Table'[Index] = Current_Index + 1)))

     

    Community Support Team _ Jimmy Tao

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

4 Replies

  • VijayP's avatar
    VijayP
    Icon for Community Champion rankCommunity Champion

    Can you please rephrase your question. Its not clear

    • Anonymous's avatar
      Anonymous
      Not applicable

      v-yuta-msft VijayP 

       

      KPIs       value

       

      ABC        18

       

      ade       18

       

      wade    27

       

      def      27 

       

       

      I want to divide the row's value by each other 

       i.e wade/def 

             ABC/ade

      I need a DAX expression what would help achieve this

       

       

             

      • v-yuta-msft's avatar
        v-yuta-msft
        Icon for Community Support rankCommunity Support

        Anonymous ,

         

        In query editor, create an index from 1, then create a calculate column using dax below:

        Result = 
        VAR Current_Index = 'Table'[Index]
        VAR Current_Value = 'Table'[value]
        RETURN
        IF(MOD(Current_Index, 2) <> 0,  Current_Value / CALCULATE(MAX('Table'[value]), FILTER('Table', 'Table'[Index] = Current_Index + 1)))

         

        Community Support Team _ Jimmy Tao

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • v-yuta-msft's avatar
    v-yuta-msft
    Icon for Community Support rankCommunity Support

    Anonymous ,

     

    Could you please share the sample data and give the expected result?

     

    Regards,

    Jimmy Tao