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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
baronraghu
Helper III
Helper III

Filter two tables

HI All,

 

I have Three Tables 

Table 1

State

Uttar Pradesh
Punjab
Tamil Nadu
Kerala

 

Table 2  
StateCityPopulation
Uttar PradeshLucknow170248
PunjabMohali467409
Tamil NaduChennai238767
KeralaKottayam440756
Uttar PradeshKanpur131319
PunjabAmritsar389309
Tamil NaduVellore158096
KeralaCochin182864

 

Table 3  
StateCityCustomers
Uttar PradeshLucknow49144
PunjabMohali38368
Tamil NaduChennai23973
KeralaKottayam38123
Uttar PradeshKanpur13518
PunjabAmritsar14859
Tamil NaduVellore42129
KeralaCochin36744

 

RElationship between Table 1 and Table 2 is through States

Relationship Between Table 1 and Table 3 is aslo through States

 

This is the output I am seeking

CityPopulationCustomers
Lucknow17024849144
Mohali46740938368
Chennai23876723973
Kottayam44075638123
Kanpur13131913518
Amritsar38930914859
Vellore15809642129
Cochin18286436744

 

I tried Using crossfilter but not getting a correct answer. Request your help

3 REPLIES 3
Anonymous
Not applicable

Thanks for the reply from @MFelix , please allow me to provide another insight: 

Hi  @baronraghu ,

 

Here are the steps you can follow:

Create calculated table.

Table =
SUMMARIZE(
    'Table2',[City],[Population],
    "Customers",
    SUMX(FILTER(ALL('Table3'),
    'Table3'[City]=EARLIER('Table2'[City])),[Customers]))

vyangliumsft_0-1718779755155.png

You might also consider creating measure:

Measure =
SUMX(
    FILTER(ALL('Table3'),
    'Table3'[City]=MAX('Table2'[City])),[Customers])

vyangliumsft_1-1718779755159.png

 

Best Regards,

Liu Yang

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

I think my query got created twice.

 

This is the original request here

https://community.fabric.microsoft.com/t5/Desktop/Cross-Filter-Two-Tables/m-p/3999126

MFelix
Super User
Super User

Hi @baronraghu ,

 

you need to create another dimension table with the cities with a one to many relationship between that table and the other two table then you can use it to create the expected visual.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.