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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
JamesLow
Frequent Visitor

One to One relationship - Filtering out unique values

I have 2 tables with unique values and I want to link the 2 tables. 1 table has more rows in than the other therefore when I link the 2 tables together in a one to one relationship, the distinct count of unique values decreases to the amount of unique values across both tables and excludes the values in the larger table that don't have a match in the other table. I want the distinct count to be to total amount of distinct values regardless if there is a match with the other table.

 

I need the relationship between the 2 tables as there is data in the smaller table for the unique values that do have a match.

1 ACCEPTED SOLUTION
v-gizhi-msft
Community Support
Community Support

Hi,

 

Please try this measure:

Measure = 
COUNTROWS (
    DISTINCT (
        UNION (
            SELECTCOLUMNS ( 'Table 1', "value", 'Table 1'[Value] ),
            SELECTCOLUMNS ( 'Table 2', "value", 'Table 2'[Value] )
        )
    )
)

The result shows the two tables' total distinct count value:

12.PNG

See my attacted pbix file.

 

Best Regards,

Giotto

View solution in original post

1 REPLY 1
v-gizhi-msft
Community Support
Community Support

Hi,

 

Please try this measure:

Measure = 
COUNTROWS (
    DISTINCT (
        UNION (
            SELECTCOLUMNS ( 'Table 1', "value", 'Table 1'[Value] ),
            SELECTCOLUMNS ( 'Table 2', "value", 'Table 2'[Value] )
        )
    )
)

The result shows the two tables' total distinct count value:

12.PNG

See my attacted pbix file.

 

Best Regards,

Giotto

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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