# Conditional Filters - Measure

Hi,

I have a dax formula which works fine.

``````No. of leads with booked sales this year =
VAR _CROPYEAR =
CALCULATE ( MAX ( GROWERORDER[CROPYEAR] ), ALL ( GROWERORDER ) )
RETURN
CALCULATE (
[Count of Total Optys],
NOT ( ISBLANK ( GROWERORDER[ORDERNUMBER] ) ),
FILTER ( GROWERORDER, GROWERORDER[CROPYEAR] = _CROPYEAR )
)
``````

Now I want to put conditions in my above formula as shown in the comments below:

``````No. of leads with booked sales this year =
--VAR YEAR = MAX(GROWERORDER[CROPYEAR])
VAR _CROPYEAR =
CALCULATE ( MAX ( GROWERORDER[CROPYEAR] ), ALL ( GROWERORDER ) )
RETURN
CALCULATE (
[Count of Total Optys],
NOT ( ISBLANK ( GROWERORDER[ORDERNUMBER] ) ),
FILTER ( GROWERORDER, GROWERORDER[CROPYEAR] = _CROPYEAR )

/* I want to put these filters in my formula"
1.  If sprint name is "Early Order Seed" then calculate "Count of Total Optys" where product is "Corn and Soybeans"
2. If sprint name is "Seed Retention - Corn, Soybeans, Cotton" then calculate "Count of Total Optys" where product is "Corn, Soybeans or Cotton"
3.  If sprint name is "Seed Retention - Sunflower, Canola" then calculate "Count of Total Optys" where product is "SUNFLOWER OIL"

Something like this:

IF(Opportunity[Sprint Name] = "Early Order Seed",
WfMartsProduct, WfMartsProduct[PRODUCT_LINE_DESC] in ("CORN", "SOYBEANS")
IF(Opportunity[Sprint Name] = "Seed Retention - Corn, Soybeans, Cotton",
WfMartsProduct, WfMartsProduct[PRODUCT_LINE_DESC] in ("CORN", "SOYBEANS", "COTTON")
IF(Opportunity[Sprint Name] = "Seed Retention - Sunflower, Canola",
WfMartsProduct, WfMartsProduct[PRODUCT_LINE_DESC]="SUNFLOWER OIL")

*/

)
``````

How do I add these conditions? In the visual, the Sprint names are in slicer. So when the sprint name changes, I want to filter the product to those particular products that I mentioned above.

-rk

Hi @rit372002, we aim to consistently improve the topics being posted on the forum to help you in getting a strong solution faster. While waiting for a response, here are some tips so you can get the most out of the forum and other Enterprise DNA resources.

• Use the forum search to discover if your query has been asked before by another member.

• When posting a topic with formula make sure that it is correctly formatted to preformatted text </>.

• Use the proper category that best describes your topic

• Provide as much context to a question as possible.

• Include the masked demo pbix file, images of the entire scenario you are dealing with, screenshot of the data model, details of how you want to visualize a result, and any other supporting links and details.

I also suggest that you check the forum guideline How To Use The Enterprise DNA Support Forum. Not adhering to it may sometimes cause delay in getting an answer.