Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet 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
How can write a DAX for below to get desired result in Result whole order fulfil column-
So, if for an order no., 'can fulfil' column is same for all items, then 1 otherwise 0 if even one item in that order is having 0 on can fulfil column. So, 1 will indicate that whole order can go together otherwise can't.
order no. | item | can fulfil | Result whole order fufil | ||
A | 123 | 1 | 1 | ||
A | 345 | 1 | 1 | ||
B | 345 | 1 | 0 | ||
B | 123 | 0 | 0 | ||
C | 456 | 0 | 0 | ||
C | 789 | 1 | 0 | ||
C | 234 | 0 | 0 | ||
D | 456 | 1 | 1 | ||
E | 287 | 0 | 0 | ||
E | 123 | 0 | 0 | ||
F | 356 | 0 | 0 |
Solved! Go to Solution.
Hi,
I am not sure if I understood correctly your question, because I am confused about order number E and F.
However, please check the below picture and the attached pbix file. It shows the same result as yours.
Result whole order fulfil CC =
VAR currentorderno = Data[order no.]
VAR filtertable =
FILTER ( Data, Data[order no.] = currentorderno && Data[can fulfil] <> 1 )
RETURN
IF ( COUNTROWS ( filtertable ) > 0, 0, 1 )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Hi @learner03 ,
You can also try this:-
Result whole order fufil =
var result = COUNTROWS(FILTER('Table','Table'[order no.] = EARLIER('Table'[order no.]) && 'Table'[can fulfil] = 0))
return IF(ISBLANK(result),1,0)
output:-
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi @learner03 ,
You can also try this:-
Result whole order fufil =
var result = COUNTROWS(FILTER('Table','Table'[order no.] = EARLIER('Table'[order no.]) && 'Table'[can fulfil] = 0))
return IF(ISBLANK(result),1,0)
output:-
Thanks,
Samarth
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi,
I am not sure if I understood correctly your question, because I am confused about order number E and F.
However, please check the below picture and the attached pbix file. It shows the same result as yours.
Result whole order fulfil CC =
VAR currentorderno = Data[order no.]
VAR filtertable =
FILTER ( Data, Data[order no.] = currentorderno && Data[can fulfil] <> 1 )
RETURN
IF ( COUNTROWS ( filtertable ) > 0, 0, 1 )
If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
87 | |
87 | |
87 | |
67 | |
49 |
User | Count |
---|---|
135 | |
113 | |
100 | |
68 | |
67 |