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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.