Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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 is repeating 3 times, it should only count as 1
how do i remove the duplicate?
can someone help me with the measure?
Solved! Go to Solution.
@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:
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.
@vjnvinod - Use DISTINCTCOUNT or maybe COUNTROWS(DISTINCT(...))
https://docs.microsoft.com/en-us/dax/distinctcount-function-dax
HI @vjnvinod ,
Use DISTINCTCOUNT to count unique rows for a column rather than using COUNTROWS or you can use DISTINCT with COUNTROWS.
UniqueCount = DISTINCTCOUNT(tablename[column])
OR
UniqueCount = COUNTROWS(DISTINCT(tablename[column]))
Thanks,
Pragati
@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:
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
106 | |
98 | |
80 | |
67 | |
63 |
User | Count |
---|---|
145 | |
111 | |
104 | |
84 | |
64 |