Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi all,
I have two tables, one is the parent table containing all company names, other is a subset with a fewer company names.
I want to create a measure to return "rated" when table 2 contains company from table 1 and "not rated" when company name does not exist in table 1.
Thanks for your help in advance.
NOTE: The number of columns in both the tables are different
Solved! Go to Solution.
@KrtinM here is a measure you can use:
Measure =
VAR _1 = MAX ('Table'[Company Name] )
VAR _2 = LOOKUPVALUE ( 'Table (2)'[Company Name] ,'Table (2)'[Company Name] , _1 )
RETURN
IF ( _2 = BLANK() , "Not Rated" , "Rated" )
Output per below:
Thanks,
Theo
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
@KrtinM here is a measure you can use:
Measure =
VAR _1 = MAX ('Table'[Company Name] )
VAR _2 = LOOKUPVALUE ( 'Table (2)'[Company Name] ,'Table (2)'[Company Name] , _1 )
RETURN
IF ( _2 = BLANK() , "Not Rated" , "Rated" )
Output per below:
Thanks,
Theo
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Hi @Anonymous ,
You can have many solutions to this depending on how your data model is. If the subset contains unique company names, you can create a one to many relationship from that table to subset to the parent table using the company columns. In the parent table which is on the many side of the relationship ( assuming a company name appears more than one), you can create a calculated column similar to below:
Rated?(Column) =
IF ( RELATED ( Subset[Company] ) <> BLANK (), "Rated", "Not Rated" )If you really want this as a measure, use this but that would be a double work.:
Rated? (Measure) =
SELECTEDVALUE (Parent[Rated?(Column)])
Alternatively, you can create calulcated column in Parent using LOOKUP function.
Hi Thanks for your reply,
I already have a calculated column in parent with rated and non rated, problem is, when i select values from slicers in table b, it wont filter visuals made from table 1 because of the relationship.
@KrtinM here is a measure you can use:
Measure =
VAR _1 = MAX ('Table'[Company Name] )
VAR _2 = LOOKUPVALUE ( 'Table (2)'[Company Name] ,'Table (2)'[Company Name] , _1 )
RETURN
IF ( _2 = BLANK() , "Not Rated" , "Rated" )
Output per below:
Works with and without relationships.
Thanks,
Theo
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Hi @Anonymous
I created 2 tables. Company D is missing from Table 2.
Table 1:
Table 2:
Ensure there's a relationship between the two:
I then created a Calculated Column in Table 1 using RELATED and also using IF to determine if RELATED returns a Company. If it does, return "Rated" otherwise return "Not Rated".
_Rated =
VAR _1 = RELATED ('Table (2)'[Company Name] )
RETURN
IF ( _1 = 'Table'[Company Name] , "Rated" , "Not Rated" )
Output is as follows:
Hope this helps. PBIX file attached for further assistance.
Theo 🙂
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Thanks for your reply Theo, I already have a calculated column like that, issue being table 1 filters table 2, if I go with filter both sides, i get other issues, hence I want a measure so that relationship issues won't appear. Am i making sense, apologies new to Power BI.
@Anonymous here is a measure you can use:
Measure =
VAR _1 = MAX ('Table'[Company Name] )
VAR _2 = LOOKUPVALUE ( 'Table (2)'[Company Name] ,'Table (2)'[Company Name] , _1 )
RETURN
IF ( _2 = BLANK() , "Not Rated" , "Rated" )
Output per below:
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Hi @Anonymous ,
You can try this measure.
Rated/Not Rated =
VAR __count =
CALCULATE (
DISTINCTCOUNT ( 'Parent'[Company] ),
FILTER ( 'Parent', 'Parent'[Company] IN VALUES ( 'Subset'[Company] ) )
)
RETURN
IF ( __count = BLANK (), "Not Rated", "Rated" )
Tested that it works with or without a relationshi between the two tables.
@KrtinM here is a measure you can use:
Measure =
VAR _1 = MAX ('Table'[Company Name] )
VAR _2 = LOOKUPVALUE ( 'Table (2)'[Company Name] ,'Table (2)'[Company Name] , _1 )
RETURN
IF ( _2 = BLANK() , "Not Rated" , "Rated" )
Output per below:
Thanks,
Theo
If I have posted a response that resolves your question, please accept it as a solution to formally close the post.
Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!
Want to connect?www.linkedin.com/in/theoconias
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 84 | |
| 49 | |
| 37 | |
| 31 | |
| 30 |