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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
MKM
Helper II
Helper II

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
Post Prodigy
Post Prodigy

Hi @MKM ,

 

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
Community Champion
Community Champion

@MKM 

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

v-denglli-msft
Community Support
Community Support

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

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
v-denglli-msft
Community Support
Community Support

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

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
Community Champion
Community Champion

@MKM 

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
Post Prodigy
Post Prodigy

Hi @MKM ,

 

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.