Forum Discussion
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.
4 Replies
- AnonymousNot applicable
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.
- mahoneypatMicrosoft Employee
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
- AnonymousNot applicable
Replicated it on your Data Too.
Measure = IF(CALCULATE(COUNT(TestData[OrderNumber]), ALLEXCEPT(TestData,TestData[OrderNumber]),TestData[col_LineItemStatus]="DE")>1,1,0)
- AnonymousNot applicable
This is Solved:
Measure = IF(CALCULATE(COUNT(TestData[OrderNumber]), ALLEXCEPT(TestData,TestData[OrderNumber]),TestData[col_LineItemStatus]="DE")>1,1,0)