Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Divide function is showing blank results

Hello all,

 

I am deviding the records from a colum "TestDefID" by counting the records with various statuses (Defect Correction in Process", "In Process", "Information Required", "Solution Proposal", "Forwarded", "Tester Action", "Wait for Defect Correction", "Confirmed", "Build Block", "Withdrawn","New") with records from the same table coum "UniqueTestCaseDescription" by counting deferent statuses("Pass", "InProgress", "Fail"). Here is the formula that i am using. Please take a look and advise.

(Formula = Total number of records with specific status/Total number of records with specific status*100)

Here is the Dax formula : - 

 

DefectDensity =
CALCULATE(
DIVIDE(
CALCULATE(
DISTINCTCOUNT(VR_DefectsManster[TestDefID]),
VR_DefectsManster[TestDefStatusText] IN {"Defect Correction in Process", "In Process", "Information Required", "Solution Proposal", "Forwarded", "Tester Action", "Wait for Defect Correction", "Confirmed", "Build Block", "Withdrawn","New"}
),
CALCULATE(
DISTINCTCOUNT(VR_DefectsManster[Unique]),
VR_DefectsManster[DefectsStatsGrouping] IN {"Pass", "InProgress", "Fail"}
)))

 

Please let me know if you need any aditional details for better ubderstanding. 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Anonymous 

     

    Resolved, formula was correct, there was a problem with relationships. 

5 Replies

  • Hi Anonymous -  create a measure to calculate the Defect Density and to ensure it correctly filters.

    DefectDensity =
    VAR DefectCount =
    CALCULATE(
    DISTINCTCOUNT(VR_DefectsManster[TestDefID]),
    VR_DefectsManster[TestDefStatusText] IN {
    "Defect Correction in Process", "In Process", "Information Required",
    "Solution Proposal", "Forwarded", "Tester Action",
    "Wait for Defect Correction", "Confirmed", "Build Block",
    "Withdrawn", "New"
    }
    )

    VAR TestCaseCount =
    CALCULATE(
    DISTINCTCOUNT(VR_DefectsManster[Unique]),
    VR_DefectsManster[DefectsStatsGrouping] IN {
    "Pass", "InProgress", "Fail"
    }
    )

    VAR Result =
    IF(
    TestCaseCount > 0,
    DIVIDE(DefectCount, TestCaseCount, 0) * 100,
    BLANK()
    )

    RETURN
    Result

     

    Once the above measure created, you can add percentage by enabling the % icon in measure tools by selecting the created measure

     

     

     

    Did I answer your question? Mark my post as a solution! This will help others on the forum!
    Appreciate your Kudos!!

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Rajendra,

       

      Thank you for taking time out for helping me. I have tried with the solution, it is still showing blank. Please see the scheenshot below. 

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        HI Anonymous,

        Can you please share a pbix or some dummy data that keep the raw data structure with expected results? It should help us clarify your scenario and test to coding formula.

        How to Get Your Question Answered Quickly  

        Regards,

        Xiaoxin Sheng

  • Anonymous's avatar
    Anonymous
    Not applicable

    Anonymous 

     

    Resolved, formula was correct, there was a problem with relationships.