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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
pparmar
Regular Visitor

creating a bucket of true and false

Y/N = IF('SO-Shipping report'[DOW_Requested] = CONTAINS(Sheet1, Sheet1[DOW_requested],AND( 'SO-Shipping report'[Shipping method] = CONTAINS(Sheet1,Sheet1[Shipping Method]), AND('SO-Shipping report'[Days Between]<= CONTAINS(Sheet1,Sheet1[Days Expected to Ship]),TRUE(),FALSE()), Blank)))

I need to create a bucket of the order id's following in this category. 
to create a custome column in table 2, where we check for the condition " if (DOW(table 2) = DOW(table 1) && shipping method(table 2) = shipping method(table 1) && Days between <= days expected to ship, "true", "false")  "
How should I go ahead and write the DAX query here ? 
for ex: this is table 1  
pparmar_0-1691606580538.png

Table2: both images belong to the same table. 

 pparmar_1-1691606657724.png pparmar_2-1691606719470.png

 

 


 

1 ACCEPTED SOLUTION
Mahesh0016
Super User
Super User

@pparmar  I have used lookup because I have no relationship between both tables you can use related if you have a relationship with both tables.

Mahesh0016_0-1691658291383.png

 

Test = 
IF (
    'DOW 2'[DOW_requested]
        = LOOKUPVALUE (
            'Dow 1'[DOW_requested],
            'Dow 1'[DOW_requested], 'DOW 2'[DOW_requested]
        )
        && 'DOW 2'[Shipping Method]
            = LOOKUPVALUE (
                'Dow 1'[Shipping Method],
                'Dow 1'[Shipping Method], 'DOW 2'[Shipping Method]
            )
        && 'DOW 2'[Day Between]
            <= LOOKUPVALUE (
                'Dow 1'[Days Expected to Ship],
                'Dow 1'[Days Expected to Ship], 'DOW 2'[Day Between]
            ),
    "True",
    "False"
)

 

 I hope this helps you! Thank You!! 

View solution in original post

1 REPLY 1
Mahesh0016
Super User
Super User

@pparmar  I have used lookup because I have no relationship between both tables you can use related if you have a relationship with both tables.

Mahesh0016_0-1691658291383.png

 

Test = 
IF (
    'DOW 2'[DOW_requested]
        = LOOKUPVALUE (
            'Dow 1'[DOW_requested],
            'Dow 1'[DOW_requested], 'DOW 2'[DOW_requested]
        )
        && 'DOW 2'[Shipping Method]
            = LOOKUPVALUE (
                'Dow 1'[Shipping Method],
                'Dow 1'[Shipping Method], 'DOW 2'[Shipping Method]
            )
        && 'DOW 2'[Day Between]
            <= LOOKUPVALUE (
                'Dow 1'[Days Expected to Ship],
                'Dow 1'[Days Expected to Ship], 'DOW 2'[Day Between]
            ),
    "True",
    "False"
)

 

 I hope this helps you! Thank You!! 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors