Forum Discussion

Adairene's avatar
Adairene
Frequent Visitor
5 years ago
Solved

A Calculated Column for Cross-Business Opportunity Distinct Count - HELP!

Hello!

 

A simple problem, but cannot wrap my head around it - could somebody please help? What is the correct DAX formula for the "Cross-Business Opportunity Distinct Count"? Thank you!

 

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi  Adairene ,

    Here are the steps you can follow:

    1. Create measure.

    Measure =
    CALCULATE(DISTINCTCOUNT('Table'[Opportunity Owner Business]),FILTER(ALL('Table'),'Table'[Opportunity]=MAX('Table'[Opportunity])))

    2. Result.

     

    You can downloaded PBIX file from here.

     

    Best Regards,

    Liu Yang

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

5 Replies

  • hey, 

     for what I could understand you dont even need a DAX if you want to get how many times a busness owner appears just add that field in the table with the owner busnees and change the agregation option on the visual field section to count (this will count how many times that value for ASR for example in row 1 appears with the combination of DEQPT--PERSON A -- ASR )

     

    since the visual will do the filtering in that format. 

     

    if this helped give some kudos, if this solves your question please mark as solution for others to find it.

    • Adairene's avatar
      Adairene
      Frequent Visitor

      Hello StefanoGrimaldi,

       

      I could do this, but then when I have a report in which there is a slicer based on the column "Opportunity Owner" and one person is selected, the distinct count is incorrect since it should always be based on the whole data (even when only one person is filtered on the report). So for example for the person C should show "2" for the opportunity HTOEL, not "1".

    • Adairene's avatar
      Adairene
      Frequent Visitor

      Hello amitchandak,

       

      The definition is that it should count the unique occurences of a "Opportunity Owner Business" under each "Opportunity". Are you able to help with this?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Adairene ,

    Here are the steps you can follow:

    1. Create measure.

    Measure =
    CALCULATE(DISTINCTCOUNT('Table'[Opportunity Owner Business]),FILTER(ALL('Table'),'Table'[Opportunity]=MAX('Table'[Opportunity])))

    2. Result.

     

    You can downloaded PBIX file from here.

     

    Best Regards,

    Liu Yang

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