Forum Discussion

jostnachs's avatar
jostnachs
Helper IV
1 year ago
Solved

Calculated column groupby

  Hi All... I have a requirement where i have to add column in one of the tables where i have to find the count of prbrnames grouped for each policy id. Policyid is in policy table and Prbrnames are...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi, jostnachs 

    Based on your information, I create sample tables:

    Policy Table

    Producer Broker Table

    Production Table

     

    Then create a new calculated column, try the following DAX expression:

    PolicyShareStatus1 = 
    CALCULATE (
        COUNT ( 'Producer Broker'[PrBrName] ),
        FILTER (
            ALL ( 'Producer Broker' ),
            'Producer Broker'[PolicyID] = EARLIER ( 'Policy'[PolicyID])
        )
    )

     

    Here is my preview:

     

    How to Get Your Question Answered Quickly

    Best Regards

    Yongkang Hua

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