Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Some values calculated correctly some are infinity

I have this weird thing I do not understand where a formula sometimes calculates infinity when I expect a percentage. 

 

FileSizeCompliancePercentage = 'Table'[Attributes.Size] / [MaxFileSizeNumber]
 
MaxFileSizeNumber is a measure saved as whole number. Attributes.Size is a column with data type decimal number. 

Any ideas how to troubleshoot this ?
  • are you creating a column?  create a measure

     

    FileSizeCompliancePercentage =
    DIVIDE ( sum('Table'[Attributes.Size]), [MaxFileSizeNumber], 0 )

3 Replies

  • vanessafvg's avatar
    vanessafvg
    Community Champion

    are you creating a column?  create a measure

     

    FileSizeCompliancePercentage =
    DIVIDE ( sum('Table'[Attributes.Size]), [MaxFileSizeNumber], 0 )

  • Anonymous's avatar
    Anonymous
    Not applicable

    well that was easy. Thanks for the help. What is the logic behind the weird behaviour ?

    • vanessafvg's avatar
      vanessafvg
      Community Champion

      you are a creating a column and mixing that with a measure.   Firstly its unnecessary to do that, calculated columns aren't very performant either.  Basically though you are trying to divide a constant by a measure, the measure is aggregated and therefore has a different context.

       

      if you have the values on the row anyway a measure will pick up the context and return the correct answer.    not sure if that explains it well enough.