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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Walt1010
Helper V
Helper V

Noob Modelling Question re Select Equivalents

I have 2 tables of phone calls, one incoming calls and 1 outgoing. Both are joined to a phone directory table that contains their numbers. The joins are both many-to-one. Both tables are also linked to a date table.

I would like to display all numbers that have incoming and outgoing calls, together with other info from the directory table. Ideally I would like to display this information by month.

I've tried just adding the phone number columns from incoming and outgoing to a table, but that didnt seem to have the effect of  displaying ones that have the same number. Any ideas would be welcomed!

 

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Walt1010 

 

Thank you very much amitchandak for your prompt reply.

 

I found your question when I checked the forum, may I ask if your problem has been solved? If not, here are some ideas.

 

Here's some dummy data

 

“Incoming Calls”

vnuocmsft_0-1724742587584.png

 

“Outgoing Calls”

vnuocmsft_1-1724742623344.png

 

“Phone Directory”

vnuocmsft_2-1724742651505.png

 

vnuocmsft_3-1724742946397.png

 

Create a new table that combines both incoming and outgoing calls.

 

CombinedCalls = 
UNION(
    SELECTCOLUMNS(
        'Incoming Calls',
        "PhoneNumber", 'Incoming Calls'[PhoneNumber],
        "CallType", "Incoming",
        "Duration", 'Incoming Calls'[Duration],
        "Date", 'Incoming Calls'[Date]
    ),
    SELECTCOLUMNS(
        'Outgoing Calls',
        "PhoneNumber", 'Outgoing Calls'[PhoneNumber],
        "CallType", "Outgoing",
        "Duration", 'Outgoing Calls'[Duration],
        "Date", 'Outgoing Calls'[Date]
    )
)

 

Create a column to identify phone numbers that have both incoming and outgoing calls.

 

HasBothCalls = 
CALCULATE(
    COUNTROWS(CombinedCalls),
    FILTER(
        VALUES(CombinedCalls[PhoneNumber]),
        COUNTROWS(
            FILTER(CombinedCalls, CombinedCalls[PhoneNumber] = EARLIER(CombinedCalls[PhoneNumber]) && CombinedCalls[CallType] = "Incoming")
        ) > 0 &&
        COUNTROWS(
            FILTER(CombinedCalls, CombinedCalls[PhoneNumber] = EARLIER(CombinedCalls[PhoneNumber]) && CombinedCalls[CallType] = "Outgoing")
        ) > 0
    )
)

 

vnuocmsft_4-1724743088097.png

 

Create a relationship between the Phone Directory table and the CombinedCalls table.

 

vnuocmsft_5-1724743194243.png

 

Filters the record for which HasBothCalls is 1.

 

vnuocmsft_6-1724743387374.png

 

And you can add a month slicer for filtering. Here is the result.

 

vnuocmsft_8-1724743544955.png

 

 

vnuocmsft_7-1724743485669.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Walt1010 

 

Thank you very much amitchandak for your prompt reply.

 

I found your question when I checked the forum, may I ask if your problem has been solved? If not, here are some ideas.

 

Here's some dummy data

 

“Incoming Calls”

vnuocmsft_0-1724742587584.png

 

“Outgoing Calls”

vnuocmsft_1-1724742623344.png

 

“Phone Directory”

vnuocmsft_2-1724742651505.png

 

vnuocmsft_3-1724742946397.png

 

Create a new table that combines both incoming and outgoing calls.

 

CombinedCalls = 
UNION(
    SELECTCOLUMNS(
        'Incoming Calls',
        "PhoneNumber", 'Incoming Calls'[PhoneNumber],
        "CallType", "Incoming",
        "Duration", 'Incoming Calls'[Duration],
        "Date", 'Incoming Calls'[Date]
    ),
    SELECTCOLUMNS(
        'Outgoing Calls',
        "PhoneNumber", 'Outgoing Calls'[PhoneNumber],
        "CallType", "Outgoing",
        "Duration", 'Outgoing Calls'[Duration],
        "Date", 'Outgoing Calls'[Date]
    )
)

 

Create a column to identify phone numbers that have both incoming and outgoing calls.

 

HasBothCalls = 
CALCULATE(
    COUNTROWS(CombinedCalls),
    FILTER(
        VALUES(CombinedCalls[PhoneNumber]),
        COUNTROWS(
            FILTER(CombinedCalls, CombinedCalls[PhoneNumber] = EARLIER(CombinedCalls[PhoneNumber]) && CombinedCalls[CallType] = "Incoming")
        ) > 0 &&
        COUNTROWS(
            FILTER(CombinedCalls, CombinedCalls[PhoneNumber] = EARLIER(CombinedCalls[PhoneNumber]) && CombinedCalls[CallType] = "Outgoing")
        ) > 0
    )
)

 

vnuocmsft_4-1724743088097.png

 

Create a relationship between the Phone Directory table and the CombinedCalls table.

 

vnuocmsft_5-1724743194243.png

 

Filters the record for which HasBothCalls is 1.

 

vnuocmsft_6-1724743387374.png

 

And you can add a month slicer for filtering. Here is the result.

 

vnuocmsft_8-1724743544955.png

 

 

vnuocmsft_7-1724743485669.png

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

 

amitchandak
Super User
Super User

@Walt1010 , The phone number should come from the phone directory table, the common table. When you want to make a measure work across two fact tables, they need to be displayed against common dimensions.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi there, so if I've got those relationships in place between the 3 tables, and I wanted to produce a visualisation showing common numbers between incoming and outgoing tables, I can create a table chart with the phone number for the directory table and other details from the other 2 details, that should do it?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.