Forum Discussion

harshagraj's avatar
harshagraj
Post Partisan
6 years ago

Divide By Zero Error- Live Connection

Hi All I am using a Live connection. I have two columns Manger Expectation and User rating. Trying to calculate Skill Index. 
Created a measure Skill Index= Divide(Average(User Rating)/ Average(Manager Expectation),0).
Now need to find out the Count of Users who are "Met" expectations. So used below Calculated measures.

Comp_Flag_LOD = IF([Skill Index]>=1,"Met","Not Met")
Comp_Met_LOD = CALCULATE(DISTINCTCOUNT('Table_RATING'[L3_NAME]),FILTER('Table_RATING',[Comp_Flag_LOD]="Met")).

I am getting the below divide by error when i use Comp_Met_LOD in Card.

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Try this measure. Instead of "/" use "," inside Divide

    Skill Index= Divide(Average(User Rating),Average(Manager Expectation),0)

    • harshagraj's avatar
      harshagraj
      Post Partisan

      Hi Anonymous  sorry my bad. Its a typo. Yes i had put , only and not /

      • amitchandak's avatar
        amitchandak
        Super User

        harshagraj , then it should have worked. Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

  • Anonymous's avatar
    Anonymous
    Not applicable

    harshagraj 
    Try create the two dax with columns rather than a measures:

    Index column = Divide([User Rating],[Manager Expectation],0).

    Comp_Flag_LOD column = IF([Skill Index]>=1,"Met","Not Met")

     

    If not working or you really need measures, maybe  show us some sample? 

     

    Paul Zheng _ Community Support Team
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • harshagraj's avatar
      harshagraj
      Post Partisan

      Hi Anonymous  thanks for the reply. I have columns as Competancy, User Rating, Manager Expectations. I created a calculated measure Skill Index = Divide(Average[User Rating],Average[Manager Expectation],0) Because user may have multiple competancy so i need to aggregate it.
      Now i need distinct count of competancy wher the user is met(Skill Index>=1) and which is a huge data.

      I tried creating a index Column but i got a error saying Average cannot be used in Live connection.
      I am so sorry i cant share the data as it is highly sensitive.