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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Switto
Helper III
Helper III

if condition between two tables

Hello Everyone,

 

I am working on Time and Motion data which requires excluding the line items which are not aligned to Project TAT.

 

So I have a table which has data for day to day line items which were completed by the team members in the process with Start and End time and duration to complete(in seconds)

 

I have another table which consists of the Process name, size of work, and Min and Max seconds to complete the particular process.

 

Please see the below table for more understanding:

 

  Table A   Table B 
Action nameSIZETime taken to process(Sec.) Action nameSIZEMin SecMax Sec
ABC Process0-200480 ABC Process0-200250750
GF Process0-2002323 ABC Process>2007502200
UI Process>2003434 GF Process0-200250750
HGF Process>2001290 GF Process>2007502200
ABC Process0-200576 UI Process0-200250750
GF Process0-200243 UI Process>2007502200
ABC Process>2002353 HGF Process0-200250750
UI Process0-200354 HGF Process>2007502200
ABC Process>2001980     

 

As we have duplicates in both the tables, I have created a bridge table and connected both the tables.

 

For example, ABC process as 4 lines of work in table A and if compare the process and size with Table B, line # 7 (highlighted in red)does not qualify and excluded from the analysis and replace with Blank.

 

Please give me some advice, on how to achieve this.

 

Thanks

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Switto - You will want to use RELATED or RELATEDTABLE or possibly LOOKUPVALUE and could also use MAXX(FILTER(...)...)


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
Greg_Deckler
Super User
Super User

@Switto - You will want to use RELATED or RELATEDTABLE or possibly LOOKUPVALUE and could also use MAXX(FILTER(...)...)


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler : Thanks for the tip. I have used the "lookupvalue" to get the data from my AHT file to Rawfile.

 

It worked for taking the minimum time however, while using it for Maximum time, got the error "A circular dependency was detected: RawFile[mMax_Time], RawFile[mMini_Time], RawFile[mMax_Time]."

 

I have used formula for mini. as 

LOOKUPVALUE(AHT[mMin_AHT_Sec],AHT[Process Name],RawFile[Action name],AHT[Size],RawFile[mTree_size])
and, Max is 
LOOKUPVALUE(AHT[mMax_AHT_Sec],AHT[Process Name],RawFile[Action name],AHT[Size],RawFile[mTree_size])
I am not sure why I am getting this.
Any idea will help.

Thanks for the tips 🙂 Let me read up and try to put into solution.

Appreciate your quick reply.

AnkitKukreja
Super User
Super User

HI @Switto 

 

Can you please share your sample pbix file if you can. It would bring more clarity to your issue.

 

Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904

If my response has successfully addressed your question or concern, I kindly request that you mark this post as resolved. Additionally, if you found my assistance helpful, a thumbs-up would be greatly appreciated.
Thanks,
Ankit Kukreja
www.linkedin.com/in/ankit-kukreja1904

Thanks Ankit for the note, however it has confidential data hence unable to share it. Appreciate you quick reply. Thanks

@Switto 

For such multiple tables senario, you can create a short sample with random data to describe your model, you are unlikely to get an expected solution without a sample pbix.

 

Regards
Paul

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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