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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
CloudMonkey
Post Prodigy
Post Prodigy

Create calcualated table

Hi,

 

Please can you tell me how to combine two tables together as below? (I mean in the data tables backend rather than in a visualisation)

 

"Transactions" Table

Transaction ID, Branch ID

 

"Branches" Table

Branch ID, Area

 

 

"Combined" Table

Area, Branch ID, Total number of transactions (count of rows in "Transactions" table)

 

Thanks for your help,

 

CM

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @CloudMonkey

 

There are many ways to do this.

 

If you want to do this in Power Query:

1. In Power Query ,Merge both tables and then apply Group by transfomation ( Transform -> Group by)

 

If you want to do this in DAX :

1. Define relationship between the tables.

2. Create a measure Count(Transactionid) and pull Branch id, area, Measure to get this data.

 

Thaks

Raj

View solution in original post

v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @CloudMonkey,

 

In Power Query, you can combine these two tables via "Merge Query". The general steps are: Merge as new queries -> Group by -> Expand columns -> Remove duplicates.

1.PNG2.PNG4.PNG

 

If you want to create a calculated table via DAX, please refer to:

Combined table =
ADDCOLUMNS (
    SELECTCOLUMNS (
        Branches,
        "BranchID", Branches[Branch ID],
        "Area", Branches[Area]
    ),
    "Count Transactions", CALCULATE (
        COUNT ( Transactions[Transaction ID] ),
        FILTER ( Transactions, Transactions[Branch ID] = EARLIER ( [BranchID] ) )
    )
)

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
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

2 REPLIES 2
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @CloudMonkey,

 

In Power Query, you can combine these two tables via "Merge Query". The general steps are: Merge as new queries -> Group by -> Expand columns -> Remove duplicates.

1.PNG2.PNG4.PNG

 

If you want to create a calculated table via DAX, please refer to:

Combined table =
ADDCOLUMNS (
    SELECTCOLUMNS (
        Branches,
        "BranchID", Branches[Branch ID],
        "Area", Branches[Area]
    ),
    "Count Transactions", CALCULATE (
        COUNT ( Transactions[Transaction ID] ),
        FILTER ( Transactions, Transactions[Branch ID] = EARLIER ( [BranchID] ) )
    )
)

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi @CloudMonkey

 

There are many ways to do this.

 

If you want to do this in Power Query:

1. In Power Query ,Merge both tables and then apply Group by transfomation ( Transform -> Group by)

 

If you want to do this in DAX :

1. Define relationship between the tables.

2. Create a measure Count(Transactionid) and pull Branch id, area, Measure to get this data.

 

Thaks

Raj

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.

Top Solution Authors