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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!