cancel
Showing results for
Did you mean:
Frequent Visitor

## Divide two columns from two different tables using a filter

Hi All,

I am trying to divide two columns from two different tables and use a common filter in a third table.

The common column or filter is the Store Name.

The two data columns which I would like to use for the calculation are Sold ending 26th August[Quantity Sold] and Dispatched[Quantity Dispatched].

I would like to divide the sum of  Sold ending 26th August[Quantity Sold](B) for a Stores[Store Name](C) by the sum of  Dispatched[Quantity Dispatched](A)

I have tried using Related() and RelatedTable() and a few other options but I am stuck.

Dispatched table where example A data is found:

Sold ending 26th August Table where B sample data is found

Stores table - where C sample data is found - I want to use this to filter the other 2 tables

This is essentially how I want this report to work- Divide the first column by the second and another column stores the result.

How the relationships are currently set up

Tables and the columns used

Also, let me know if any more information is needed as I am new to these forums and rather new to PowerBI.

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

## Re: Divide two columns from two different tables using a filter

That being said, I'm thinking something along the lines of:

Measure = DIVIDE(SUMX(RELATEDTABLE('Sold ending 26th August'),[Quantity]),SUMX(RELATEDTABLE('Dispatched'),[Quantity Dispatched]))

### I have book! Learn Power BI from Packt

Proud to be a Datanaut!

Super User

## Re: Divide two columns from two different tables using a filter

That being said, I'm thinking something along the lines of:

Measure = DIVIDE(SUMX(RELATEDTABLE('Sold ending 26th August'),[Quantity]),SUMX(RELATEDTABLE('Dispatched'),[Quantity Dispatched]))

### I have book! Learn Power BI from Packt

Proud to be a Datanaut!

Announcements

#### Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

#### Community News & Announcements

Get your latest community news and announcements.

#### Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

#### Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Top Kudoed Authors
Users Online
Currently online: 47 members 949 guests
Recent signins: