Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Unexpected Infinity

Hi,

 

I have a dataset similar to the below.

 

DateJob IDNorm HoursTotal Hours
01/01/202111020
01/01/202121020

 

I am trying to calculate 'Contract Factor'. I have created the below DAX.

 

Contract Factor =SUM('Detailed Data Set'[Total Hours]) / SUM('Detailed Data Set'[Norm Hours])

 

When this measure is entered into a table visual I get the below response.

 

DateJob IDNorm HoursTotal HoursContract Factor
01/01/2021110202
01/01/202121020infinity 

Infity is not expected.

 

I have tried creating a card visual, entering the Contract Factor measure and filtered on job '2'. The card displays the expected result '2' (total hours [20] /  norm hours [10]). 

 

I have also tried creating the Contract Factor calculation as a calculated column. When put into a table visual this displays infinity for all Contract Factors.

 

Does anyone know why I am getting unexpected 'infinity' results?

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous , 

Use divide to avoid divide by 0. The reason why infinity is shown is that there are some values that are 0. 0 divided by a number is infinity. You can use the divide function to avoid infinity because the function can get 0 when it encounters a value of 0. Or you can make a conditional judgment, for example a/b, if a is 0 then get 0, otherwise a/b.

 

I cannot reproduce your issue. 

vpollymsft_0-1646112139255.png

Please try to create a measure.

 

IFERROR(
   SUM('Detailed Data Set'[Total Hours]) / SUM('Detailed Data Set'[Norm Hours]),
    BLANK()
    )

 

vpollymsft_0-1646112264230.png

 

If I have misunderstood your meaning, please provide some sample data and desired output.

 

I have alse found a similar post, please refer to it to see if it helps you.

Infinity error 

  • If infinity error then use divide

Best Regards

Community Support Team _ Polly

 

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

 

 

View solution in original post

9 REPLIES 9
Anonymous
Not applicable

Hi @Anonymous , 

Use divide to avoid divide by 0. The reason why infinity is shown is that there are some values that are 0. 0 divided by a number is infinity. You can use the divide function to avoid infinity because the function can get 0 when it encounters a value of 0. Or you can make a conditional judgment, for example a/b, if a is 0 then get 0, otherwise a/b.

 

I cannot reproduce your issue. 

vpollymsft_0-1646112139255.png

Please try to create a measure.

 

IFERROR(
   SUM('Detailed Data Set'[Total Hours]) / SUM('Detailed Data Set'[Norm Hours]),
    BLANK()
    )

 

vpollymsft_0-1646112264230.png

 

If I have misunderstood your meaning, please provide some sample data and desired output.

 

I have alse found a similar post, please refer to it to see if it helps you.

Infinity error 

  • If infinity error then use divide

Best Regards

Community Support Team _ Polly

 

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

 

 

Samarth_18
Community Champion
Community Champion

HI @Anonymous ,

 

Please try this:-

Contract Factor =divide(SUM('Detailed Data Set'[Total Hours]),SUM('Detailed Data Set'[Norm Hours]),0)

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

Thanks for your quick response.

 

This has replaced all previous 'infinity' figures with '0' where they should still be returning a value higher than '0'.

 

Using the bar graph visual I have placed column 'Job ID' on the X axis of a graph visual and 'Contract Factor' DAX on the Y axis.

 

This returns a result with all Job ID's displaying their expected Contract Factor. Contract Factors that are displaying as 'Infinity' or '0' in a table visual now show as the expected value in a bar graph. 

 

I don't understand why the table visual is showing different results for the same data.

@Anonymous Try this:-

Contract Factor =divide(SUM('Detailed Data Set'[Total Hours]),SUM('Detailed Data Set'[Norm Hours]))

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

Unfortunately same result. All previous 'infinity' Contract Factors are now displaying as '0'

@Anonymous Set the value to two decimal places from the ribbon.

Samarth_18_0-1645712657020.png

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

The values are set to two decimal places. 

 

For example,

 

Job ID 10 is showing 4.73 on the bar graph

Job ID 10 is showing 0.00 on the table visual

Job ID 10 is showing 4.73 on the card visual  

@Anonymous Is it possible for you to share PBIX file after removing sensitive data?

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Anonymous
Not applicable

Unfortunately this is not possible.

 

I have just tried filtering the table on a specific Job ID and adding a total column. The expected Contract Factor is 9.24 and can be seen in the total but not in the value box.

Serdet_0-1645714477791.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.