Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I have a table with customers and their region (based on postcode). What I am trying to do is divide the sum of the customers from that area to total population for that area (which I have in another table, each row having these fields, in this order: area name, area postcode, area total population)
Example:
table one
Customer1 - PK13 8JJ
Customer2 - TR11 7LN
Customer3 - IZ2 9TV
Customer4 - PK13 8JJ
Customer5 - TL1 4VS
Customer 6 - PK13 8JJ
table two
PK13 8JJ - 1254
KL12 4EW - 1711
IZ2 9TV - 1109
So I want: 3/1254 = 0.23%
Thank you!
Solved! Go to Solution.
@Talos , You can achieve this using DAX create a measure
DAX
CustomerPopulationRatio =
VAR SelectedPostcode = SELECTEDVALUE(Table1[Postcode])
VAR CustomerCount =
CALCULATE(
COUNTROWS(Table1),
Table1[Postcode] = SelectedPostcode
)
VAR TotalPopulation =
CALCULATE(
SUM(Table2[TotalPopulation]),
Table2[Postcode] = SelectedPostcode
)
RETURN
DIVIDE(CustomerCount, TotalPopulation, 0)
And make sure there is relation between both table your both tables on basis of post code column
Proud to be a Super User! |
|
@Talos , You can achieve this using DAX create a measure
DAX
CustomerPopulationRatio =
VAR SelectedPostcode = SELECTEDVALUE(Table1[Postcode])
VAR CustomerCount =
CALCULATE(
COUNTROWS(Table1),
Table1[Postcode] = SelectedPostcode
)
VAR TotalPopulation =
CALCULATE(
SUM(Table2[TotalPopulation]),
Table2[Postcode] = SelectedPostcode
)
RETURN
DIVIDE(CustomerCount, TotalPopulation, 0)
And make sure there is relation between both table your both tables on basis of post code column
Proud to be a Super User! |
|
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!