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
Hi,
I am having trouble counting the number of occurences for an attribute, in this case ContractID & StartDate. Basically I need to count how many distinct Start Date for each ContractID and show the result in the same table.
| Contract ID | Invoice ID | Start Date | Invoice Sales | Count |
| 2024001 | AA111 | 5/2/2024 | 1000 | 3 |
| 2024001 | AA112 | 5/2/2025 | 1000 | 3 |
| 2024001 | AA113 | 5/2/2026 | 1000 | 3 |
| 2024001 | AA114 | 5/2/2026 | -1000 | 3 |
| 2024001 | AA115 | 5/2/2026 | 1000 | 3 |
| 2024002 | AA116 | 5/9/2024 | 1000 | 2 |
| 2024002 | AA117 | 5/9/2025 | 1000 | 2 |
| 2024003 | AA118 | 5/5/2024 | 1000 | 1 |
| 2024004 | AA119 | 5/10/2024 | 1000 | 1 |
| 2024005 | AA120 | 5/11/2024 | 1000 | 1 |
| 2024006 | AA121 | 5/15/2024 | 1000 | 2 |
| 2024006 | AA122 | 5/15/2025 | 1000 | 2 |
I have tried using the following: countrows(summarize('Table1', 'Table1'[ContractID]))
And the result is always 1 instead of my expected result (see below)
I think this is just a missing link to aggregate the count to the ContractID. Hope someone can help.
Thanks,
Cat
Solved! Go to Solution.
Hi @Catman - Create a New Column as below:
It works, please check
Proud to be a Super User! | |
Thank you so much, it is working as expected now.
Hi @Catman - Create a New Column as below:
It works, please check
Proud to be a Super User! | |
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |