Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I am trying to create a Measure or a Column that will count the distinct information either based on an account number or first/last name. I tried COUNTROWS, I tired DISTINCT, and even 'Grouped By', but not having success. So either I am missing something or I don't know the easiest way to do this. Below is the data that I have ...
For those that are highlighted yellow, I would like the next column to contain a 2, 3 or 4. For those in white, those would only be 1.
Any assistance on how I can establish this information, would greatly be appreciated.
Thanks!
Hi @CA8172 , try this:
Measure = CALCULATE(COUNTROWS(myTable),ALLEXCEPT(myTable,myTable[Account Number]))
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
Proud to be a Super User!
@Nathaniel_C - I did as you suggested (see below), but it counted each row and is showing 21,912 for each Case Number, etc (see screen shot) when I try to put it all in a Table visualization.
It is filtered with account number, if you drag account number column to the table it should be clear.
If you want to countrows for each Case Number(Request Id) you need to change the "ALLEXCEPT" function to ALLEXCEPT(TableA,TableA[Case Number])).
Paul
Hi @CA8172 ,
Would you share a picture of your data model relationships?
Thanks,
Nathaniel
Proud to be a Super User!
Dummied PBIX
Hi @CA8172 ,
So here is a pbix with dummied data, it is one table with a measure that is applied to a table. See if this gives you an idea.
Let me know if you have any questions.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
Proud to be a Super User!
Someone had asked about the logic, but might have figured it out since it appeared to be deleted. However I will still respond.
And now looking at it, I forgot one column "Products". So when a customer is interested in a product, they request it. Which then creates a Case Number. That is the only unique key that is different for similar customers. So take for example Sam Spring, he has two cases, because he is interested/purchased two different products (ie: Sweater and Phone Charger).
I hope that clarifies the difference, since I forgot to include "Products" in the screen shot.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |