Forum Discussion
Count Distinct in visual issue
Hello Anonymous
Please check your relationship is many-to-one, ensure that the cross-filtering is set to "Single" direction, from the "many" side (Product/DSKU) to the "one" side (Store Number). You can adjust this in the "Manage Relationships" dialog box in Power BI. Setting it to "Both" might be causing an over-count as it's trying to filter both ways.
Also create a measure that handles the distinct count more explicitly:
DistinctDSKU = CALCULATE(DISTINCTCOUNT(ProductTable[DSKU]), ALL(StoreTable))
If you want to preserve the filtering from Store Number but still get a correct count of distinct DSKU, you can use ALLExcept
DistinctDSKU = CALCULATE(DISTINCTCOUNT(ProductTable[DSKU]), ALLEXCEPT(ProductTable, ProductTable[DSKU]))
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