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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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

 

View solution in original post

Kedar_Pande
Resident Rockstar
Resident Rockstar

@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
Resident Rockstar
Resident Rockstar

@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

 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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

Top Solution Authors