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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
D_PBI
Post Partisan
Post Partisan

Retrieve columns from a Direct Query table into a Import Mode table, performing an aggregation too.

Hi
I have the following Import Mode table named 'Sales':

D_PBI_0-1692794500831.png


I also have the following Direct Query table named 'Branch':

D_PBI_1-1692794536084.png


I would like to perform a SUM on the Amount column, per TYPE and return those calculated values to the Sales table. The end result should look like the following table:

D_PBI_0-1692794885133.png


Ther are no relationships joined/connected between the tables. However, the joining fields would be Sales[Ref No.] to Branch[Code].
How do I complete this in DAX?
Thanks.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @D_PBI ,

 

If you don't want to create a relationship, you can try creating a calcualted table using DAX.

Table 2 = FILTER(CROSSJOIN('Table','Table_1'),[Ref No.]=[Code])

vstephenmsft_0-1692955134943.png

It's the result.

vstephenmsft_1-1692955149706.png

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

7 REPLIES 7
D_PBI
Post Partisan
Post Partisan

@Anonymous - thank you.

Anonymous
Not applicable

Hi @D_PBI ,

 

If you don't want to create a relationship, you can try creating a calcualted table using DAX.

Table 2 = FILTER(CROSSJOIN('Table','Table_1'),[Ref No.]=[Code])

vstephenmsft_0-1692955134943.png

It's the result.

vstephenmsft_1-1692955149706.png

                                                                                                                                                         

Best Regards,

Stephen Tao

 

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

thamzaoui
Regular Visitor

ok 

how to do that with in power query by merging and group by 

 

thamzaoui_1-1692803568062.png

 

BUMP.

Thanks for your efforts but you cannot do that with a composite model.

thamzaoui
Regular Visitor

Hi

No need for DAX. You can do this easily with Matrix visualization

No, you can't. You need a method to join the two tables via DAX. There is no relationship set up in the model pane. I need to understand how to achieve my request in the OP.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.