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
Chandrashekar
Resolver III
Resolver III

Unique Count : Between Multi Tables

Hello,

 

Could you please help to get DAX formula to get Unique count between two tables.

PBIX: PBIX Sample 

Formula: 

Measure2 = CALCULATE(COUNTROWS(DISTINCT(Table2[Number2])),treatas('Table1',Table1[Number],Table2[Number2]))

 

Regards,

Chandrashekar B

1 ACCEPTED SOLUTION

@Chandrashekar 
You can use 

Count Available in Both = 
COUNTROWS ( 
    FILTER ( 
        INTERSECT ( 
            VALUES ( Table1[Number] ), 
            VALUES ( Table2[Number2] ) 
        ), 
        NOT ISBLANK ( [Number] ) 
    ) 
)

1.png

View solution in original post

5 REPLIES 5
Chandrashekar
Resolver III
Resolver III

Hello,

 

Could you please help to get DAX formula to get Unique count between two tables.

 

PBIX: PBIX Sample 

Formula: 

Measure2 = CALCULATE(COUNTROWS(DISTINCT(Table2[Number2])),treatas('Table1',Table1[Number],Table2[Number2]))
Answer: Should be 5 as A4 is missing in Table2

 

Regards,

Chandrashekar B

 

 

Hi Chandra,

What exactly are you trying to count?

Hello,

 

am trying to count Number ticket(Table1) present in Table2.

Kindly note Table2 may have Number which is not present in Table1.

 

Regards,

Chandrashekar B

@Chandrashekar 
You can use 

Count Available in Both = 
COUNTROWS ( 
    FILTER ( 
        INTERSECT ( 
            VALUES ( Table1[Number] ), 
            VALUES ( Table2[Number2] ) 
        ), 
        NOT ISBLANK ( [Number] ) 
    ) 
)

1.png

Hello,

 

Thank you. It is working fine.

 

Regards,

Chandrashekar B

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