Showing results for 
Search instead for 
Did you mean: 
prices35 Frequent Visitor
Frequent Visitor

Referencing Unrelated Data



I am a newbie to DAX and I am working on Forecasting and need to reference the "TL APPROVALS" from the previous "Payment_No".  Everything I have tried has resulted in something similar to what you see in the "Last PMT Approvals" below.  Can someone please help me find a DAX formula that will work to give me the desired results I have placed in the last column of the table below?  TIA

Order Co DATE (Year)Order Co MONTHpartner_prog_idPayment_NoTL APPROVALSLast PMT Approvals I want the Last PMT Approvals to give these results
   16851,832 1,312
   23141,832 685
   31921,832 314
   41431,832 192
   51081,832 143
 05-MAY Total  2,7541,832  
   15371,324 947
   22421,324 537
   31451,324 242
   41061,324 145
   5771,324 106
 06-JUN Total  2,0541,324 77
2015 Total   4,8083,156  
Grand Total   4,8083,156  
samdthompson Established Member
Established Member

Re: Referencing Unrelated Data

Looks like you have a join happening on date rather than payment number, hence the PMT approvals summing at a month level rather than a payment level.

Make a calculated column with a related() function to make sure the pmt approval data is coming across properly, and then make the measure based on that (more long winded but you know the join is working by seeing the column). You can then just sumx() to get latest pmt approvals.

prices35 Frequent Visitor
Frequent Visitor

Re: Referencing Unrelated Data



I am really just trying to reference the response from the previous payment so if you are looking at the row with Payment_No 1 I could use a formula that would say =if(Payment_No 0 approvals = 0, 0, 1).  I have thought about using the approval date and just look back to last month but that doesn't work because Payment_No 0 is a 14 day trial.  That would mean looking back 1 month would give you approvals on Payment_No 0 and some of Payment_No 1.  Any suggestions?



Moderator Eric_Zhang

Re: Referencing Unrelated Data


To get the expected output, you can either create a new column in the "Data page" or in the "Edit query page".

Column = SUMX(FILTER(Sheet1,
	EARLIER(Sheet1[Order Co DATE (Year)])=Sheet1[Order Co DATE (Year)]
	EARLIER(Sheet1[Order Co MONTH])=Sheet1[Order Co MONTH]

In Data page


In Edit quries 



Helpful resources

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Power BI Helps Homeless and Trouble Youth

Power BI Helps Homeless and Trouble Youth

We spoke with Power BI Super User, Greg Deckler, about his charity work

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 120 members 1,648 guests
Please welcome our newest community members: