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!Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.
Hi, I'm new to Power BI. I have 2 tables.
Table 1 shows number of people entering a supermarket, who bought apples.
Table 2 shows number of people who entered the supermarket. They could have bought anything.
What I want is to take Table 1, on a daily basis, take the number of people (count) who were in Table 1, and divide that count by the number of people (another count) who went to the supermarket from Table 2.
What I want is to see out of the number of people who went to the supermarket, what percentage bought apples, and have that percentage split by date.
Table 1
DAY | PERSON | Good |
1 | Person 1 | Apples |
1 | Person 2 | Apples |
2 | Person 3 | Apples |
2 | Person 4 | Apples |
Table 2
DAY | PERSON | Goods |
1 | John | Apples |
1 | Sarah | Cereal |
1 | Michael | Bananas |
2 | John | Pork |
Solved! Go to Solution.
Hi,
Create a Table with 2 entries - 1 and 2. Build a relationship from the Day column of both your Tables to the Day column of this new Table. In your visual, drag the Day column from this new Table. Write these measures
People buying apples = CALCULATE(COUNTROWS(Table1),Table1[Good]="Apples")
People visiting = COUNTROWS(Table2)
% of people buying apples = [People buying apples]/[People visiting]
Hope this helps.
Hi,
Why does the Person column of the two Tables not match.
That's because I wanted to put emphasis on the person's names not matching. I want the number of people who bought apples divided by the number of people who entered the store on Day 1 or Day 7 etc.
@Ashish_Mathur wrote:Hi,
Why does the Person column of the two Tables not match.
Hi,
Create a Table with 2 entries - 1 and 2. Build a relationship from the Day column of both your Tables to the Day column of this new Table. In your visual, drag the Day column from this new Table. Write these measures
People buying apples = CALCULATE(COUNTROWS(Table1),Table1[Good]="Apples")
People visiting = COUNTROWS(Table2)
% of people buying apples = [People buying apples]/[People visiting]
Hope this helps.
Should the relationship be Many to Many? Also, should cross filter direction be both or single direction?
Also can I write what you did as one measure, with the division taking place in it?
@Ashish_Mathur wrote:Hi,
Create a Table with 2 entries - 1 and 2. Build a relationship from the Day column of both your Tables to the Day column of this new Table. In your visual, drag the Day column from this new Table. Write these measures
People buying apples = CALCULATE(COUNTROWS(Table1),Table1[Good]="Apples")
People visiting = COUNTROWS(Table2)
% of people buying apples = [People buying apples]/[People visiting]
Hope this helps.
Hi,
It should be Many to 1, Single. Try this single measure
=CALCULATE(COUNTROWS(Table1),Table1[Good]="Apples")/COUNTROWS(Table2)
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.