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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
yaya1974
Helper III
Helper III

Need formula help

Hello,  I have 2 tables with absolutely nothing to create a relationship.  But I need data from the first table into the second table, filtered on data from the second table.  I have this formula but it is not returning correct value.   Can someone please help?

 

Adj = IF(ABC[Customer]="A",CALCULATE(FIRSTNONBLANK(Commodities[Adj],1),ALLEXCEPT(ABC,ABC[Model],ABC[Finish],ABC[PL Market])))

 

I've even tried using multiple filters and still same result.   I do not want to use a measure or powerquery, he needs to be a new column.

 

it is returning (0.218) for all rows.  I am expecting Jan-Jun 0.0181 and Jul-Dec 0.0242

 

Thank you!

11 REPLIES 11
sjoerdvn
Super User
Super User

If there are no relationships between the tables, you should be using LOOKUPVALUE or TREATAS.

ok.  I did sorta get it to work.  using lookupvalue.  However, the issue is from Table 1. The adj column is not filling in all the way, so I first need to get issue in table 1 fixed.  here is my dax code for adj column in table 1.  can anyone help fix this?

 

yaya1974_0-1722867406895.png

 

Thank you!

 

mmm, didn't you say that your date columns where actually text type? If that is the case than things like MIN, MAX and EARLIER are not going to work if the date format is mmm-yy. 
So you would need to create a proper date column first, and although you could try that in DAX, I would advice to do that in Power Query or even in the source if that's possible.

Correct they were text, but I did already switch to date, to get the lookupvalue to work.  

Biggest issues is getting all rows to fill in.   Thanks!

Anonymous
Not applicable

Hi, @yaya1974 

May I ask if you have gotten this issue resolved? If it is solved, please share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.


If it is not resolved, I hope you will provide the full .pbix file via OneDrive or SharePoint. Please be careful to remove all sensitive information and we will do our best to provide ideas for your issue.

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello,  No it is not resolved, still looking how to get the rows filled in.  Unfortunately I am not able to provide files, due to my company blocking anyone outside of company.  All I have is the screen shot above.

Do you have a suggestion on how I can share?   Sorry, I do appreciate everyone's help though!!

Thank you!

Lori

So for that first table, you want a computed column, where the result is the difference between the current value and the most recent value that was different ?

But does that table also have a column that indicates the customer? and the values should be determined by customer?

Anonymous
Not applicable

Hi, @yaya1974 

I am glad to help you.

 

Since there are no relationships between the tables, the formula in ALLEXCEPT in the DAX formula you provided does not achieve the result you are expecting. 

vfenlingmsft_0-1722850622369.png

 

Could you please provide some examples of text format data in the tables (excluding sensitive data), along with your expected results, calculation logic and special examples. Simplified pbix files would be great. 

 

 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

yaya1974_0-1723651602717.png

My formula works, I am getting the correct output, BUT I need it to fill in the rest of the rows.  I have color coded the rows that need filled in with the same number.  My code just needs to be corrected somehow to fill in, I just can't figure that out.

Thank you!

Hello,  thank you for responding.  Here is a screen shot of what I am looking for.  Unfortately I get blocked when trying to share a document.   Hope this helps.   My date columns are not "dates" they are text too btw.

 

yaya1974_0-1722865532038.png

 

Thank you for any help!

Lori

adudani
Super User
Super User

Hello,

Kindly provide the sample input/output in a usable format (excel, csv, table etc.) masking sensitive information.

reference : https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447... 

Thanks,

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

Helpful resources

Announcements
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.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.