cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AaronGlenn10
Helper III
Helper III

Trying to divide a measure by a field in a separate table

I have measure which calculates cumulative (12 month) of sales for a city -- and, I have the population for that city in a separate table ["Demographics"].  Trying to create a measure which divides the cumulative sales by the city's population so I can get a per person sales figure.

 

Thank you!  ~AGS

 

 

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @AaronGlenn10 

Thanks for reaching out to us.

 

Try this, (supposing the name of your measure is measure1)

(1) create a table visual, and put city field from Sales into it

vxiaotang_0-1637309399369.png

(2) create the measure and put it into table visual

SalesPerPerson=
    var _population = CALCULATE(MAX(Demographics[population]),Demographics[city]=MAX(Sales[city]))
return [measure1]/_population

 

If this doesn't help, then you may need to make small changes to your measure, 

Could you share

(1) measure which calculates cumulative (12 month) of sales for a city

(2.1) a sample file

(2.2) or post some sample data in text, e.g.

Sales

date city sales
2021/1/1 city1 1
2021/2/1 city2 2
? ? ?
? ? ?

Demographics

city population
city1 2
city2 3

(3) expected result

 

 

Best Regards,

Community Support Team _Tang

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

Thank you!

Helpful resources

Announcements
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors