Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
LABrowne
Helper II
Helper II

DAX: PLACEHOLDER ERROR

Hi there,

 

I have the below code:

 

No. of Orders =
CALCULATE (
    COUNTROWS(Orders),
    NOT(CONTAINSSTRING(Orders[OrderId], "Cancel")),
    NOT(CONTAINSSTRING(Orders[OrderId], "Under Review")),
    FILTER(VALUES(Orders[OrderId], [OrderFil (%)] >= 1))).
 
Any help would be great thanks very much.
1 ACCEPTED SOLUTION
Dangar332
Super User
Super User

hi, @LABrowne 

 

try below

CALCULATE (
    COUNTROWS(Orders),
    NOT(CONTAINSSTRING(Orders[OrderId], "Cancel")),
    NOT(CONTAINSSTRING(Orders[OrderId], "Under Review")),
    FILTER(
       VALUES(Orders[OrderId]),
      [OrderFil (%)] >= 1
    )
  )

View solution in original post

4 REPLIES 4
Dangar332
Super User
Super User

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!

123abc
Community Champion
Community Champion

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.