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
Anonymous
Not applicable

Need a help with applying filter from table that are connect through bridge table.

Hello,

 

Can you please help me with following querry:

 

I have two tables Transactional and Email Activity table.  Both has many to many relation based on compnay id.  To avoid many to relation, I created bridge table with unique compnay ids.  My main table (fact table) is Email Activity table. I want to create filter where I could filter email activities based on product type. 

 

I want to use date from Email activity table. Like how many email were sent and how many they purchased the products.

I want to use single directional filter to avoid any issues.

 

I am ok with both measure or column.  I want to use date from Email activity table.

 

Thankyou so much for any give help

 

 

Transactional Table:

Transaction Data  
Company IDDatesProduct type 
11/15/2020AB
11/16/2020AC
11/17/2020DE
21/20/2020FX
21/20/2020EX
31/15/2020FX
101/16/2020FX
101/17/2020FXG
111/18/2021AB
111/19/2021AC
52/30/2021AD
12/3/2021AD

 

Email Activity:

Email Activity  
DateContact Email  addressCompanyID
2020-JAN-1A1
2020-JAN-1B1
2020-JAN-2B1
2020-JAN-3C2
2020-JAN-4D3
2020-JAN-5E12
2020-JAN-6F11
2020-JAN-7G10
2021-JAN-1X5
2021-JAN-1F7
2021-JAN-2H8
2021-JAN-3L8
2021-JAN-4I9
2021-JAN-5I9
2021-JAN-6E12
2021-JAN-7A1
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create measure.

Year_measure =
var _select=SELECTEDVALUE('Email Activity'[CompanyID])
return
MAXX(FILTER('Transactional Table','Transactional Table'[Company ID]=_select),[year])
Year_measure =
var _select=SELECTEDVALUE('Email Activity'[CompanyID])
return
MAXX(FILTER('Transactional Table','Transactional Table'[Company ID]=_select),[year])

2. Result:

vyangliumsft_0-1637733180882.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

View solution in original post

8 REPLIES 8
Anonymous
Not applicable

Hi  @Anonymous ,

Here are the steps you can follow:

1. Create measure.

Year_measure =
var _select=SELECTEDVALUE('Email Activity'[CompanyID])
return
MAXX(FILTER('Transactional Table','Transactional Table'[Company ID]=_select),[year])
Year_measure =
var _select=SELECTEDVALUE('Email Activity'[CompanyID])
return
MAXX(FILTER('Transactional Table','Transactional Table'[Company ID]=_select),[year])

2. Result:

vyangliumsft_0-1637733180882.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

Nathaniel_C
Community Champion
Community Champion

Hi @Anonymous , sorry for the misunderstanding, but it is still not clear what you are after.  For example Co1 sent 3 emails in 2020, right? and 1 in 2021. Then Co1 purchased 3 products in 2020 - AB, AC, DE - and 1 product in 2021 - AD-.  However your result table does not reflect that.
Thank you,

Nathaniel

 





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

Proud to be a Super User!




Anonymous
Not applicable

@Nathaniel_C  My apologies, Yes you are very right.  I need to create a filter of product type on the Email activity table which can filter a number of emails send. Just like in this case, If I have to apply filter on  Product AB then we it will give an output of 3 for 2020 year.

I appreciate your time in helping me into it.

Thank you so much!

 

Company IDProduct Type Email Sent Year
1AB32020
1AC32020
1DE32020
1AD12021

 

 

Nathaniel_C
Community Champion
Community Champion

Hi @Anonymous , I am sorry, but where does TypeEmail come from?
Nathaniel





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

Proud to be a Super User!




Anonymous
Not applicable

@Nathaniel_C 

Sorry, table was not clear earlier.  Product type and Email send are two seperate columns. Email send is coming from email activity ( i.e it is main  table) and Product type is coming from transactional date. 

 

Thankyou so much

 

Company ID Product Type Email Send Year
1AB12020
1AB12021
1AC12020
2FX12020
2EX12020
Nathaniel_C
Community Champion
Community Champion

Hi @Anonymous @VahidDM ,

Would you please give us what your expected outcome would look like?


Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel





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

Proud to be a Super User!




Anonymous
Not applicable

Hi @Nathaniel_C :

 

I need resutls  some thing like this : 

I want to know  how many email we sent and what product they have purchased.  I have to make the relation bewteen above table based on compnay IDs.  Any suggestions are welcome!

 

Thankyou so much !

Company IDProduct TypeEmail Send Year
1AB12020
1AB12021
1AC12020
2FX12020
2EX12020
VahidDM
Super User
Super User

Hi @Anonymous 

 

You need to add a Calendar Table (Date Table) to your model and connect those 2 tables with that.

How to create a Calendat Table : https://www.vahiddm.com/post/creating-calendar-table-with-3-steps

 

Then you can use date from Calendar table to find the Related Emails and Peoducts.

 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

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.