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
feyd
Frequent Visitor

Sum of distinct counts over filtered months

Hi everyone,

 

my dataset looks like this:

Customer ID

Amount

Amount Group

Type

Date

1

55

100

T

02/2017

2

45

50

TT

02/2017

3

50

50

TC

02/2017

1

20

50

TC

02/2017

2

50

50

T

03/2017

3

45

50

TT

03/2017

4

55

100

TC

03/2017

1

20

50

TC

03/2017

3

10

50

T

03/2017

 

As you can see I have 3 unique Customer IDs in 02/2017 date and 4 unique Customer ID's in 03/2017. So the sum of distinct Customer IDs for these two months is 7.

 

How to get this sum dynamically, based of filtering across few/or more months?

 

What I get as result when filtering across these two months is 4, which is true since that is the number of distinct CustomerIDs.

 

Please note that I need filtering capability of the result with date, type and Amount Group…

 

Any ideas?

 

Thanks!

1 ACCEPTED SOLUTION

Hi @feyd

 

Try this MEASURE

 

measure =
SUMX (
    VALUES ( TableName[Date] ),
    CALCULATE ( DISTINCTCOUNT ( TableName[Customer ID] ) )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

4 REPLIES 4
mattbrice
Solution Sage
Solution Sage

measure =
SUMX ( VALUES ( Calendar[Month-Year] ), DISTINCTCOUNT ( Table[Customer ID] ) )

Thank you for quick reply!

 

I've created the measure and sumx returns 8 instead of 7...

 

 

Hi @feyd

 

Try this MEASURE

 

measure =
SUMX (
    VALUES ( TableName[Date] ),
    CALCULATE ( DISTINCTCOUNT ( TableName[Customer ID] ) )
)

Regards
Zubair

Please try my custom visuals

@feyd

 

1031.png


Regards
Zubair

Please try my custom visuals

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.