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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
jgray72
Helper II
Helper II

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 2
v-joesh-msft
Solution Sage
Solution Sage

Hi @jgray72 ,

I'm a little confused by your description. Sample data and expected output would help tremendously. Please see this post regarding How to Get Your Question Answered Quickly:
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

Best Regards,

Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.

 
 

examples.JPG

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.