Why is my Count (distinct) not working the way I would expect it to be? PowerBI

My total is set as Count (distinct). However, the total itself doesn't make any sense, as you can see in my attachment. Any ideas what I'm doing wrong? By not making any sense, I mean that the numbers above are not being added.

Any suggestions would be greatly appreciated.

• If I am following correctly, the table is telling you that you have 79, 78, 80, and 83 distinct values in each of those respective months. The Total number of distinct values in the data is 85. Could you confirm this, please? Jan 7 '20 at 18:02

Count distinct is a measure (aggregate function). When the measure is used in the total row, it is not summing the distinct count values about but is calculating the function in the context of all the table data. Without seeing the data I would make the assumption that there are 85 distinct values between those 4 months. March, for example, happens to contain 83 of 85 of those values.

If you want a sum of the values above, you can use SUMX.

Example:

Count of ProjectName =
SUMX (
VALUES ( 'put table name here'[MonthNameShort] ),
CALCULATE ( DISTINCTCOUNT ( 'put table name here'[ProjectName] ) )
)


Comparison in Power BI: