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
Anonymous
Not applicable

how to get flag value

Hi Team,

 

I have table table A and table B ... see the below result .. how i can achieve on the based on DAX measuare.

Please check and provide an update 

tblA 1,2,3,4,5
tblB 3,4,9,10

 

result 
tblBID   Flag
31
41
90
100
3 ACCEPTED SOLUTIONS
Rupak_bi
Solution Sage
Solution Sage

Hi @Anonymous ,

 

Here is your solution in a calculated column. this is the simple one. please let me know if you really wanna do this in a measure.

Rupak_bi_0-1732783700321.pngRupak_bi_1-1732783734640.png

 



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

View solution in original post

Kedar_Pande
Super User
Super User

@Anonymous 

Calculated Column:

Flag = 
IF(
tblB[ID] IN DISTINCT(tblA[ID]),
1,
0
)

This creates a new column in tblB with the same result.

💌 If this helped, a Kudos 👍 or Solution mark ✔️ would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

View solution in original post

Anonymous
Not applicable

Thanks for the reply from Rupak_bi and Kedar_Pande, please allow me to provide another insight.
Hi @Anonymous ,

You can use the following DAX to create a table that meets your needs.

Table = 
ADDCOLUMNS (
    TableB,
    "Flag",
        IF (
            ISBLANK ( LOOKUPVALUE ( TableA[tblAID], TableA[tblAID], TableB[tblBID] ) ),
            0,
            1
        )
)

vdengllimsft_0-1732865408353.png


Best Regards,
Dengliang Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Thanks for the reply from Rupak_bi and Kedar_Pande, please allow me to provide another insight.
Hi @Anonymous ,

You can use the following DAX to create a table that meets your needs.

Table = 
ADDCOLUMNS (
    TableB,
    "Flag",
        IF (
            ISBLANK ( LOOKUPVALUE ( TableA[tblAID], TableA[tblAID], TableB[tblBID] ) ),
            0,
            1
        )
)

vdengllimsft_0-1732865408353.png


Best Regards,
Dengliang Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Kedar_Pande
Super User
Super User

@Anonymous 

Calculated Column:

Flag = 
IF(
tblB[ID] IN DISTINCT(tblA[ID]),
1,
0
)

This creates a new column in tblB with the same result.

💌 If this helped, a Kudos 👍 or Solution mark ✔️ would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn

Rupak_bi
Solution Sage
Solution Sage

Hi @Anonymous ,

 

Here is your solution in a calculated column. this is the simple one. please let me know if you really wanna do this in a measure.

Rupak_bi_0-1732783700321.pngRupak_bi_1-1732783734640.png

 



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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