Forum Discussion

jgray72's avatar
jgray72
Helper II
6 years ago

Help with Dax Expression - nested if?

Hi all - I have a formula that works which determines if items have been excessively rounded.  However, I have been given new criteria, only the current buy + the next 3 buys should be reviewed.  The purchases instances is at the "style" level, while the redball calculation goes down to "style color."  I tried Dates in Period, but it doesn't work.  How can I change the criteria of my formula redball to only look at the next 4 buys?

 

Redball =
 
 
SUMX (
SUMMARIZE (
PROD_PLAN_RPT_v,
PROD_PLAN_RPT_v[Colm_Buy_Date],
PROD_PLAN_RPT_v[SapMaterialFamily],
PROD_PLAN_RPT_v[Colorway],
PROD_PLAN_RPT_v[Vendor_Code],
PROD_PLAN_RPT_v[Global_Supply_Planner],
PROD_PLAN_RPT_v[SP_MODEL],
"SumRedball", IF([Sum Orig Qty]<>0&&[Percent Rounded]>0.5, 1, 0)
),
[SumRedball]
),0)
______________________________________________________________________________________________________________________________________
Purchase Instances = 
CALCULATE(DISTINCTCOUNT(PROD_PLAN_RPT_v[Colm_Buy_Date]), PROD_PLAN_RPT_v[Units]>0)
 
Min Buy Date = MIN(PROD_PLAN_RPT_v[Colm_Buy_Date])
 
Thank You,
JG
 

2 Replies

    • jgray72's avatar
      jgray72
      Helper II

      Hi!  Below are some examples of what I expect to be returned (or not returned) from the measure.  All in all, the analysts don't want to look at buys that are happening further out in the future.  I was thinking Dates in Period might work, as you could say today's date + 60 days (if there is excessive rounding on a buy within the next 60 days, review it),but I can't figure out how to get that to work on the current measure.