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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
v-yangliu-msft
Community Support
Community Support

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.