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
pmadam
Helper II
Helper II

DAX Help

Hi All,

 

I am trying to create a measure to show as 1 if either of the line item status is 'DE' for that order number.

I created on measure but its displaying as 1 only for that line number with DE as status for that order but  It should display as 1 for all the lines if either of line status is 'DE'

 

Please help.

 

123.png

4 REPLIES 4
Megha166
Microsoft Employee
Microsoft Employee

@pmadam 

This is Solved:

Megha166_0-1602720238519.png

Measure = IF(CALCULATE(COUNT(TestData[OrderNumber]), ALLEXCEPT(TestData,TestData[OrderNumber]),TestData[col_LineItemStatus]="DE")>1,1,0)
Megha166
Microsoft Employee
Microsoft Employee

This is how I did it on my data set. COuld you please share your DAX query and sample data file. I can replicate the code for you.

 

Megha166_0-1602719214868.png

 

Replicated it on your Data Too.

 

Measure = IF(CALCULATE(COUNT(TestData[OrderNumber]), ALLEXCEPT(TestData,TestData[OrderNumber]),TestData[col_LineItemStatus]="DE")>1,1,0)

Please try this expression in your measure

 

NewMeasure =
VAR DErows =
    CALCULATE (
        COUNTROWS ( Table ),
        ALL ( Table ),
        VALUES ( Table[Order Number] ),
        Table[col_LineItemStatus] = "DE"
    )
RETURN
    IF (
        DErows >= 1,
        1,
        0
    )

 

Regards,

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.