Forum Discussion

chrisgehm's avatar
chrisgehm
Helper III
9 years ago
Solved

Divide 2 columns

Hi!

 

I've got a simple table in excel, where I have Name, Amount1 and Amount2

 

I need to show in PBI the diference betwen both and after that, I need to divide the diference with Amount1.


The difference it is calculated correctly, but when I divide, the results are not the real ones, and don't know why.


Any idea why?

 

 

 

  • Sean's avatar
    Sean
    9 years ago

    You need to use only MEASURES for this! :smileyhappy:

     

    Amt1 Total = SUM('Table'[Amount1])
    
    Amt2 Total = SUM('Table'[Amount2])
    
    Difference = [Amt1 Total] - [Amt2 Total]
    
    Divide = DIVIDE ( [Difference], [Amt1 Total], 0 )

13 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi chrisgehm

     

    It's a bit hard to answer your question without a pic of the data at least.

    I assume you tried to solve your problem in DAX?

    • chrisgehm's avatar
      chrisgehm
      Helper III

      Anonymous

       

      This is the excel

       

       

      This is what I have in PBI:

       

       

      Do you know why the division is not correct?

      • Sean's avatar
        Sean
        Community Champion

        You need to use only MEASURES for this! :smileyhappy:

         

        Amt1 Total = SUM('Table'[Amount1])
        
        Amt2 Total = SUM('Table'[Amount2])
        
        Difference = [Amt1 Total] - [Amt2 Total]
        
        Divide = DIVIDE ( [Difference], [Amt1 Total], 0 )