Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi there,
I have the below code:
Solved! Go to Solution.
hi, @LABrowne
try below
CALCULATE (
COUNTROWS(Orders),
NOT(CONTAINSSTRING(Orders[OrderId], "Cancel")),
NOT(CONTAINSSTRING(Orders[OrderId], "Under Review")),
FILTER(
VALUES(Orders[OrderId]),
[OrderFil (%)] >= 1
)
)
hi, @LABrowne
try below
CALCULATE (
COUNTROWS(Orders),
NOT(CONTAINSSTRING(Orders[OrderId], "Cancel")),
NOT(CONTAINSSTRING(Orders[OrderId], "Under Review")),
FILTER(
VALUES(Orders[OrderId]),
[OrderFil (%)] >= 1
)
)
Thank you very much!
Assuming that you want to count the number of orders where the order ID does not contain "Cancel" or "Under Review" and the corresponding order fill percentage is greater than or equal to 1%, you can use the following modified code:
No. of Orders =
CALCULATE (
COUNTROWS(Orders),
NOT(CONTAINSSTRING(Orders[OrderId], "Cancel")),
NOT(CONTAINSSTRING(Orders[OrderId], "Under Review")),
Orders[OrderFil (%)] >= 1
)
In this modified code, I removed the unnecessary FILTER function and simplified the conditions within the CALCULATE function. The conditions for "Cancel" and "Under Review" are applied using the NOT(CONTAINSSTRING(...)) functions, and the condition for the order fill percentage is applied directly.
Make sure to replace "Orders" and "OrderId" with your actual table and column names if they are different in your dataset.
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.
Hi there,
Sorry I am still getting the error I should have mentioned that [OrderFil (%)] is a measure.
Kind regards,
Luke
User | Count |
---|---|
53 | |
22 | |
18 | |
16 | |
11 |
User | Count |
---|---|
80 | |
57 | |
40 | |
19 | |
10 |