When you are working in Excel it is relatively easy to divide two numbers. You take the value from one cell, and divide it by the value or the in another cell. For Example =B3/B2. Divide is a basic mathematical operator. In Excel if you try to divide a value by zero you will get the error #DIV/0!
Power BI and Power Pivot don’t work on cell references like Excel. They both work on columns of data. It is very common to add a calculated column using divide. A perfect example would be on a sales table to take the profit column and divide it by sales column to get the gross profit %.
Using the mathematical divide in Power BI or Power Pivot can lead to a problem if your table of data contains a 0. Instead of returning an error, you will be returned with the symbol for infinite ∞. It is also common not to spot this error. This is because when you are working with your data in Power BI or Power Pivot, only a subset of your data is visible. It is possible that zeros are further down your data set and you have not seen them.
So how can you overcome this problem in Power BI or Power Pivot? DAX is to the rescue the DIVIDE function. The syntax is =DIVIDE(Numerator, Denominator, [AlternateResult])
In this video ‘DAX for Power BI and Power Pivot – DAX Divide Function’ you will see how using the standard mathematical divide can yield ∞. You will also see how this can be avoided by using the DAX Divide function
Wakati wewe ni kufanya kazi katika Excel ni rahisi kugawanya namba mbili. Kuchukua thamani kutoka kwa seli moja na kuigawanya kwa thamani ya seli nyingine. Kwa mfano, B3 = B3 Kugawanya ni operator ya msingi ya hisabati. Katika Excel kama wewe kujaribu kugawanya thamani na sifuri utapata kosa #DIV/0! Power BI na Power Pivot hazifanyi kazi kwenye marejeleo ya seli kama Excel. Wote wawili wanafanya kazi kwenye safu za data. Ni kawaida sana kuongeza safu mahesabu kwa kutumia kugawanya. Kwa mfano, katika meza ya mauzo, unaweza kuchukua safu ya faida na kuiga kwa safu ya mauzo ili kupata faida ya jumla. Kutumia mgawanyiko wa hisabati katika Power BI au Power Pivot inaweza kusababisha tatizo kama meza yako ya data ina 0. Badala ya kurudi kosa, wewe itakuwa akarudi na ishara kwa ajili ya infinite <unk>. Pia ni jambo la kawaida kutoona kosa hilo. Hii ni kwa sababu wakati wewe ni kufanya kazi na data yako katika Power BI au PowerPivot, tu subset ya data yako ni kuonekana. Inawezekana kwamba sifuri ni zaidi chini ya seti yako ya data na hujaona yao. Jinsi ya kuepuka tatizo hili katika Power BI DAX ni kwa ajili ya uokoaji kazi ya DIVIDE. Syntax ni = DIVIDE(Numerator, Denominator, [AlternateResult]) Katika video hii <unk>DAX kwa Power BI na Power Pivot <unk> DAX Divide Function <unk> utaona jinsi kutumia kiwango cha hisabati kugawanya inaweza kutoa <unk>. Pia utaona jinsi hii inaweza kuepukwa kwa kutumia DAX Kugawanya kazi