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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

DAX Help - Criteria from multiple tables

Hey All,

 

I have a situation where I need to create a measure that takes into account data from multiple tables.

 

The first table is a membership table. There is a row for each person and the month they are eligible. The second table is a transaction table.

 

I want to do a calculation with the following parameters

 

Sum number of transactions of a certain type from the transaction table where the transaction month = membership month. So if this is February 2019 and all your transactions of the specified type are prior February they would be excluded.

 

I'm thinking I need a calculate with filter but I am thinking the filter should say where membership month = transaction month but that isn't working. Any ideas?

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

 Hi all,

 

Thanks for all the help. After digging into this further I found that the issue is likely due to the relationship passing through an intermediate table which was confusing the DAX. I used SQL to bring the data over to one table and the calculation is no working properly.

 

James

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

 

Create a relationship from the Data column in your transaction table to the date column in the Calenda Table.  In the Calendar Table, create two additional columns for Year and Month.  Year = YEAR(Calendar[Date]) and Month = FORMAT(Calendar[Date],"mmmm").  In your visual, drag Year and Month from the Calendar Table.  Write this measure

 

Total sales = SUM(Data[Sales])

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

 Hi all,

 

Thanks for all the help. After digging into this further I found that the issue is likely due to the relationship passing through an intermediate table which was confusing the DAX. I used SQL to bring the data over to one table and the calculation is no working properly.

 

James

v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

I'm working on this, it is better to provide some example data which fit your scenario.

 

Best Regards

Maggie

Aron_Moore
Solution Specialist
Solution Specialist

Calculate filter should work.

 

Could you post a snip of data (fake if you need to) and the measure you tried?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.