Forum Discussion
vjnvinod
6 years agoImpactful Individual
How to remove duplicate from measure
hi Team, I am using a function countrows to get the count details of the regions, however i don't want the duplicate to be counted 2 or 3 times based on their repetition for instance if Canada ...
- 6 years ago
vjnvinod ,
Countrows function returns count of rows per criteria.
If there are 3 rows for Canada, it will return value 3.
On the other hand, if you would like to count have many distinct items(for example) were sold in Canada, they you should write measure like this:DistinctCount = DISTINCTCOUNT('Item'[Item Id])
Furthermore, if you are using list or matrix, it will give you unique combinations of data (unique combinations of country/region) so there should be no duplicate rows on visualization.
v-alq-msft
6 years agoCommunity Support
Hi, vjnvinod
Based on your description, I created data to reproduc your scenario. The pbix file is attached in the end.
MSL:
You may create a measure as below.
Count =
COUNTROWS(
DISTINCT(MSL[Region])
)
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.