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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
THENNA_41
Post Partisan
Post Partisan

Conditions True or False based on the two table

 

I have a two table one table Global Another one Local .  Both table have common value Itemnumber , based on  

 

Global Table :

 

Itemnumber      Pack 

101                  

102                 

103                   NewHL

104                   NewPack 

 

 

 

Local Table :

 

Itemnumber     BOMTEXT 

101                  

102                   CH

103                   

104                   NewPack 

 

 

Based on the item i am trying  to get true or false result 

 

Global Pack                       

Local (BOM text)                                                              

Output Result

Blank

Blank / Item code is missing in local input file

TRUE

Blank

Value

FALSE

Value

Blank / Item code is missing in local input file

FALSE

Value

Value

TRUE

 

 

Expect Output:

 

Itemnumber      Pack              BOMTEXT             true/false

101                                                                        TRUE

102                                             CH                      FALSE

103                   NewHL                                         FALSE

104                   NewPack         NewPck                TRUE

 

 

Looking for support.  thanks in advance..

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @THENNA_41 ,

 

According to your statement, I suggest you to try this code to create a measure.

True/False =
VAR _ADD =
    ADDCOLUMNS (
        'Global',
        "True/False",
            IF (
                (
                    'Global'[Pack] = BLANK ()
                        && NOT ( 'Global'[Itemnumber] IN VALUES ( Local[Itemnumber] ) )
                )
                    || ( 'Global'[Pack] = RELATED ( Local[BOMTEXT] ) ),
                "TRUE",
                "FALSE"
            )
    )
RETURN
    MAXX ( _ADD, [True/False] )

Result is as below.

RicoZhou_0-1672730520516.png

 

Best Regards,
Rico Zhou

 

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

4 REPLIES 4
tamerj1
Super User
Super User

Hi @THENNA_41 
Please refer to attached sample file

1.png

True/False = 
IF (
    NOT ISEMPTY ( Local ),
    IF ( 
        SELECTEDVALUE ( Local[Pack] ) = SELECTEDVALUE ( 'Global'[Pack] ),
        "True",
        "False"
    )
)
v-rzhou-msft
Community Support
Community Support

Hi @THENNA_41 ,

 

According to your statement, I suggest you to try this code to create a measure.

True/False =
VAR _ADD =
    ADDCOLUMNS (
        'Global',
        "True/False",
            IF (
                (
                    'Global'[Pack] = BLANK ()
                        && NOT ( 'Global'[Itemnumber] IN VALUES ( Local[Itemnumber] ) )
                )
                    || ( 'Global'[Pack] = RELATED ( Local[BOMTEXT] ) ),
                "TRUE",
                "FALSE"
            )
    )
RETURN
    MAXX ( _ADD, [True/False] )

Result is as below.

RicoZhou_0-1672730520516.png

 

Best Regards,
Rico Zhou

 

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

tamerj1
Super User
Super User

Hi @THENNA_41 

if the tables are connected with a relationship, then you can use 

True/False =

SELECTEDVALUE ( Local[Pack] ) = SELECTEDVALUE ( Global[Pack] )

Anonymous
Not applicable

Hi,

 

I created a demo for you, I think this might be help.

 

Column = IF((RELATED(GlobalTable[Pack])=blank() && LocalTable[Pack]=Blank()) ||(RELATED(GlobalTable[Pack])<>blank() && LocalTable[Pack]<>Blank()),TRUE,FALSE)

 

EzgiAslankara_0-1672678843547.png

 

EzgiAslankara_1-1672678879969.png

If the answer helps please accept the solution 🙂

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.