Skip to main content
cancel
Showing results for 
Search instead 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.

Reply
K-LED
Helper I
Helper I

DISTINCT COUNT of articles

Hello,

 

For each month I'm calculating the DISTINCT COUNT of articles and I have this result below :

25-10-2019 08-49-29.png


When I'm calculating the sum of the results for all months I have 2388. It's different from the sum displayed by the matrix visual 2280 :

25-10-2019 08-41-21.png

The problem is some articles existed in different months...

 

How to calculte the sum for each month without counting the same articles for different months ?

 

Thanks in advance.

Regards.

2 REPLIES 2
sturlaws
Resident Rockstar
Resident Rockstar

Hi, @K-LED,

If I understand you correctly, you want to make sure an article is not counted in two different months. How to do this will depend on what your data look like.

 

Assuming your data has an orderID, your measure could look like this:

Measure =
COUNTROWS (
    FILTER (
        ADDCOLUMNS (
            SUMMARIZE ( 'Table'; 'Table'[OrderID]; 'Table'[ArticleID] );
            "minDate"; CALCULATE ( MIN ( 'Table'[Date] ); ALL ( 'Table'[Month] ) )
        );
        [minDate] = CALCULATE ( MIN ( 'Table'[Date] ) )
    )
)


Cheers,
Sturla

Hi,

 

Thanks @sturlaws for your response

 

Kind regards,

Helpful resources

Announcements
Microsoft Fabric Learn Together

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

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors