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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
crln-blue
Post Patron
Post Patron

Column for filter is from a different table

Hello!

 

I have a calculated measure where its filters will base on another table. I looked this up and some results says that I should merge the two tables. I did and it is taking too much time and I think it's not right. Below are my tables:

 

AR Table (simplified table):

Customer NameG/LCategory1Category2Date1Date2Arrears DateArrears Date 2Amount
      (Custom Column from Power Query)(Arrears Date minus 1 year) 

 

Sales Table (simplified table):

Customer NameCategory1Category2Date1Posting DateLC Amount
      

 

The only key to them is thru the Customer Name Column. Almost all of my measures are from AR data mainly because this is my main table and this is where Arrears Date is (used in all my visualizations). But I have one measure where its filters are from both of the tables

Sales GL = Calculate sum of (sales data) LC Amount when (sales data) Posting Data >= (AR data) Arrears Date && (sales data) Posting Data <= (AR data) Arrears Date 2 && (sales data) Type <> "CC" && (sales data) Type && (sales data) Type <> "DZ"
 

The domino effect because of Sales GL (all measures from AR data):

DSO = (Measure from AR data/ Sales GL) * 360
Best DSO = Measure from AR data / Sales GL 
ADD = [DSO] - [Best DSO]
 
Based on past questions & answers from this community, merged table is needed but it takes too much time and I don't think it's right either. I tried replicating Arrears Date to sales data table but it gives one value when using it with the measures from the main table. I believe only one date column must be used in order to get the expected results. 
 
I also think there's something wrong in my approach? Not sure. But any help is appreciated. Thank you!
1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @crln-blue ,

 

Try this measure.

Sales GL = CALCULATE(SUM('Sales'[LC Amount]),FILTER('Sales',[Posting Date]>=MAX('AR'[Arrears Date])&&[Posting Date]<=MAX('AR'[Arrears Date 2])&&[Category1]<>"CC"&&[Category2]<>"DZ"))

16.png 

 

What does the domino effect caused by Sales GL mean?

 

 

Best Regards,

Stephen Tao

 

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

2 REPLIES 2
v-stephen-msft
Community Support
Community Support

Hi @crln-blue ,

 

Try this measure.

Sales GL = CALCULATE(SUM('Sales'[LC Amount]),FILTER('Sales',[Posting Date]>=MAX('AR'[Arrears Date])&&[Posting Date]<=MAX('AR'[Arrears Date 2])&&[Category1]<>"CC"&&[Category2]<>"DZ"))

16.png 

 

What does the domino effect caused by Sales GL mean?

 

 

Best Regards,

Stephen Tao

 

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

Hello! Thanks for this! I didn't realize that they have to be connected. Will close this thread now.

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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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