Forum Discussion

HenryJS's avatar
HenryJS
Post Prodigy
6 years ago
Solved

Count Ref IF

Hi all,

 

How do I create a measure which counts 'CompanyHQOriginalSourceRef' IF Type = "Business Development" or "Top 10"?

 

 

 

  • Hi HenryJS 

     

    Try This 

    Measure = 
    CALCULATE(
        DISTINCTCOUNT( 'Table'[CompanyHQOriginalSourceRef] ),-- or COUNTROWS( 'Table' ),
        'Table'[Type] IN { "Business Development", "Top 10" }
    )

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    LinkedIn


     

  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi HenryJS,

    I haven't found any ranking fields in your table, can you please explain more about your data structure?

    How to Get Your Question Answered Quickly 

    In addition, You can try to use the following measure formula if it suitable for your requirement:

    Measure =
    CALCULATE (
        COUNTA ( Table[CompanyHQOriginalSourceRef] ),
        FILTER (
            ALLSELECTED ( Table ),
            [Type] = "Business Development"
                && [Rank] <= 10
        )
    )
    

    Regards,

    Xiaoxin Sheng

  • Hi,

    Try this measure

    =CALCULATE(COUNTROWS(Data),Data[Type]="Business Development"||Data[Type]="Top 10")

    Hope this helps.

3 Replies

  • Mariusz's avatar
    Mariusz
    Community Champion

    Hi HenryJS 

     

    Try This 

    Measure = 
    CALCULATE(
        DISTINCTCOUNT( 'Table'[CompanyHQOriginalSourceRef] ),-- or COUNTROWS( 'Table' ),
        'Table'[Type] IN { "Business Development", "Top 10" }
    )

     

    Best Regards,
    Mariusz

    If this post helps, then please consider Accepting it as the solution.

    Please feel free to connect with me.
    LinkedIn


     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi HenryJS,

    I haven't found any ranking fields in your table, can you please explain more about your data structure?

    How to Get Your Question Answered Quickly 

    In addition, You can try to use the following measure formula if it suitable for your requirement:

    Measure =
    CALCULATE (
        COUNTA ( Table[CompanyHQOriginalSourceRef] ),
        FILTER (
            ALLSELECTED ( Table ),
            [Type] = "Business Development"
                && [Rank] <= 10
        )
    )
    

    Regards,

    Xiaoxin Sheng

  • Hi,

    Try this measure

    =CALCULATE(COUNTROWS(Data),Data[Type]="Business Development"||Data[Type]="Top 10")

    Hope this helps.