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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Help with a formula

I have a question, how can I make this formula in a data table in power Bi?
=IF(COUNTIF(NCN[Lotid],[@LOTID])>0,1,0)

 
 

I have a question, how can I make this formula in a data table in power Bi?
=IF(COUNTIF(NCN[Lotid],[@LOTID])>0,1,0)


What I want to do is the following.
A new column containing 1 or 0 according to the conditional.

If the data in the LOTID column in the Anodes table matches the LotID data of the NCNs table, then in the column put a 1
if not
put a 0

Table Anodes                                       Table NCNs

Screenshot (80).png   Screenshot (81).png

thanks.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,

in Power Query, you have to

merge Anodes with NCNs, in left join mode,

expand the NCNs column in the Anodes query selecting only LotID column

add conditional column in the Anodes query setting if NCNs.LotID = null then 0 else 1

remove NCNs.LotID column

 

Regards

Lorenzo

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

@Nathaniel_C , @Anonymous 
Thank you very much for your time and help.

Nathaniel_C
Super User
Super User

Hi @Anonymous ,
Try this:

 

Lookup = IF(LOOKUPVALUE(myTable2[Column1],myTable2[Column1],myTable1[Column1],0)=0,0,1)

 

Create a calculated column. If you substitute your tables for myTable2, and myTable1, this will work.

Let me know if you have any questions.

If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos 👍are nice too.
Nathaniel
lookp1.PNG

 

lookp.PNG

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

@Nathaniel_C Thank  you very much for your response I found it interesting and another question arose.

I need to add that same calculated column after week of year to the anode table, how can I do it?

Screenshot (83).png

 

Anonymous
Not applicable

Hi,

in Power Query, you have to

merge Anodes with NCNs, in left join mode,

expand the NCNs column in the Anodes query selecting only LotID column

add conditional column in the Anodes query setting if NCNs.LotID = null then 0 else 1

remove NCNs.LotID column

 

Regards

Lorenzo

Anonymous
Not applicable

@Anonymous  thank you very much your answer helped me solve my problem.

Screenshot (84).png

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.