Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
37 | |
25 | |
19 | |
14 | |
8 |
User | Count |
---|---|
69 | |
48 | |
44 | |
19 | |
15 |