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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
DanaElaine
Regular Visitor

Subtracting columns in two tables with filter where one needs to be grouped

I have two related tables with information about how groups spent their budget. The groups can use two different payment methods.

  • Table A has one row per group with the absolute total spent. 
  • Table B has one row per order per group when the group paid using payment method one. 

I'm trying to find the amount that each group spent using the other payment method.

 

If both tables had one row per group, I believe I could use a measure like this: Other_Total = SUMX('TableA', 'TableA'[TotalBudgetUsed]) - SUMX('TableB', 'TableB'[OrderTotal])

However, most groups have multiple orders. 

 

Any suggestions? Thanks in advance!

1 REPLY 1
v-yiruan-msft
Community Support
Community Support

Hi @DanaElaine ,

Is there any relationship created between 'Table A' and 'Table B'? If yes, what's the base field? Could you please provide some raw data in the table 'Table A' and 'Table B' (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

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

Helpful resources

Announcements
September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Top Solution Authors