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
Hello!
I'm trying to get the distinct count function to determine the number of distinct batches we have made. I've used the following logic:
Unique Batches = CALCULATE (
DISTINCTCOUNT ('Production'[BatchNum]))
And when I click in the sample data on each batch, I can see that in most cases, it's working. For example, B10059 has two batch numbers but is only counted as one, which is expected.
However, there are a few where it's simply not working. Here, it's counted three times
Querying the data, I don't see any issue with formatting. BatchNum is definitley the same and should only be counted once. There are three hits in the data set, but that shouldn't matter in this case if BatchNum has the same value.
Any idea why I'm not always gettign a distinct count in Power BI? Many thanks in advance.
Solved! Go to Solution.
Hi @formerlyknownas ,
Can you try using the following measure instead?
Unique Batches = DISTINCTCOUNT('Production'[BatchNum])
There may be a context issue with the previous version.
Pete
Proud to be a Datanaut!
Thanks, Pete. I made a new measure according to your suggestion, and it worked. I don't think I created a proper measure the first time around.
Eric
Hi @formerlyknownas ,
Can you try using the following measure instead?
Unique Batches = DISTINCTCOUNT('Production'[BatchNum])
There may be a context issue with the previous version.
Pete
Proud to be a Datanaut!
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 | |
| 46 | |
| 42 | |
| 23 | |
| 18 |
| User | Count |
|---|---|
| 193 | |
| 124 | |
| 101 | |
| 67 | |
| 49 |