Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello Gurus,
I have a situation as following:
I have two table as the screenshots you see here:
My final goal is to create a Custom Column in which it produces the values in Col F of the first table (1st screenshot), it has 7 values like F1, F2, F3, F7 and it's Text type, when the values in column Max of the second table(below screenshot) falls between the Min and Max of the first table.
So to sum up, I have made a connection through Column Key in both tables. I have 2 different conditions:
1. Check if Column Code of 2nd table matches with Column Code of first table (as relevant screenshots)
2. Check if the value in Column Max of the second table falls between the Min and Max columns of the first table
then it shows the relevant value in Column F of the first table(1st screenshot) in the custom column of the 2nd table. Just an extra note, finally I have Sum the values in final Qty based on their value in column F of the 2nd table to show in my visual.
Many thanks in advance.
P.s. values in col Final Qty, Min, Max and Max of both tables are Type Whole Number and everything else is Type text.
Solved! Go to Solution.
Hi @Anonymous ,
Believe that the best option is to use the FIRSTNONBLANK formula applying a FILTER to the columns you need.
Add a custom column with the following code and see if it works.
F Code = CALCULATE ( FIRSTNONBLANK ( Table1[F]; 1 ); FILTER ( Table1; Table1[Code] = Table2[Code] && Table1[Max] >= Table2[Max] && Table1[Min] <= Table2[Max] ) )
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi,
You will need to merge the columns and create a custom column with an IF statement.
Create a sample pbix file, and I'd be happy to help further.
Robbe
No need to leave a general comment please!
Already tagged my question with IF and mentioned custom column in its body,
Thanks
My main point was,
Create a sample pbix file...
Dont always expect minimum effort for maxiumum result...
Hi @Anonymous ,
Believe that the best option is to use the FIRSTNONBLANK formula applying a FILTER to the columns you need.
Add a custom column with the following code and see if it works.
F Code = CALCULATE ( FIRSTNONBLANK ( Table1[F]; 1 ); FILTER ( Table1; Table1[Code] = Table2[Code] && Table1[Max] >= Table2[Max] && Table1[Min] <= Table2[Max] ) )
Regards,
MFelix
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em Português@MFelixThanks!
The only part is that I have vriable Max values which makes it difficult to group and generalize them using the FirstBlank!
This is why I am confused
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsThanks @MFelix for taking the time to reply. Actually in the pic I shared the value in the Max column varies based on the value in column F and Column Code. Maybe the best question I should have asked you was what Firstnonblank() function does in the measure? If you please explain it a little bit more I think it might be the most helpful hint
Thank you very much again @MFelix and looking forward to hearing from you
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsJoin the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.