cancel
Showing results for
Did you mean:

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.

Regular Visitor

## Filters don't return the correct count

Im calculating some total values doing a count and filtering the rows with duplicate values in one column (Id Cliente)

When calculating the total without filters the row count is correct, but when adding filters i get wrong values.

When doing the count without filtering out any values I receive the correct number of rows: 4844

But when applying filters to filter out row that contain a certain value i receive the wrong count (80 values more than what it should)

This is what i should receive: 3513

Its clear its a problem with the filters but i don't grasp what its not adding up, can someone help me or give me the correct DAX measure?

3 REPLIES 3
Regular Visitor

Hi,

The count I made is already returning it correct, the problem I have is when filtering out some rows depending of its value in a column.

Regular Visitor

Hi there,

As per my understanding of the problem, you are trying to get a count of distinct values based on a column.

Try this measure:

For count of distinct values:

MeasureName = COUNTROWS(ALL([TableName][ColumnName]))

Example: Measure = COUNTROWS(ALL(Product_Table[return_date]))

Output:

Hope this helps!

Regular Visitor

Hi,

The count I made is already returning it correct, the problem I have is when filtering out some rows depending of its value in a column.

'''Total Cupones =
CALCULATE(
COUNTROWS(
SUMMARIZE(
CRM,
CRM[Id Cliente]
)
),
NOT(
CRM[Promocion Periodo Cupon] IN {"OPPRCC - Petición reabrir cupón", "RPRCUP - Recupón", "RPRCUP - Recup��n"}
|| CRM[Motivo de cierre] IN {"G - Gestión Solicitud", "Gestión de solicitud"}
)
)'''

Announcements

#### Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

#### Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

#### Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors