Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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