Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
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 in producer broker table. the relation between two tables is through a common table called production. I am using the below formula
PolicyShareStatus1 =
VAR c = CALCULATE ( COUNT ( 'Producer Broker'[PrBrName] ), ALLEXCEPT ( 'Policy', Policy[_PolicyID] ) )
RETURN
C
But the result is not as expected. If you see below the table the same policy number having multiple prbrnames has to have number 3 instead of 1
Solved! Go to Solution.
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.
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.
Hello @jostnachs ,
Can you please try with Disticntcount logic like the below..
PolicyShareStatus1 =
CALCULATE(DISTINCTCOUNT('Producer Broker'[PrBrName]),
ALLEXCEPT('Policy', 'Policy'[PolicyID]))
If you find this helpful , please mark it as solution which will be helpful for others and Your Kudos/Likes 👍 are much appreciated!
Thank You
Dharmendar S
Still no luck....gives me the same result as it gave me previously
Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.
Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 64 | |
| 31 | |
| 29 | |
| 24 |