The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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 |
---|---|
17 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |