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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Morton041740
Frequent Visitor

DATEADD contiguous date error

I am working with a stock inventory report and would like to add a what if parameter to allow the report user to pick a number of days by which they change the stock expiry date either positive or negative and the results of this would be displayed on a graph showing when the stock would be unavailable due to expiry. Ultimately, I want to combine this with a sales forecast chart to plot stock expiry against projected sales with a percentage what if parameter on the sales forecast and a number of days what if parameter to adjust the expiry dates.

This is my chart so far with forecast sales and actual expiry dates. I have the percentage sales difference working but am hitting some problems with the expiry date what if parameter.Stock Chart.png

 

 

 

 

 

 

 

 

 

 

 

I have a calendar table available and a stock table with stock availability and expiry date columns. The model has a disabled relationship between the expiry date and the Calendar table. I was trying to find the number of days to expiry from the current date using a what if parameter to add or subtract days from the actual expiry date using the following formula. 

 

What If days to expiry = CALCULATE(DATEADD('Calendar'[Date], 'Change in Expiry Date'[Change in Expiry Date Value], DAY) - TODAY(),USERELATIONSHIP('StockPriceData'[Expiry Date], 'Calendar'[Date]),ALL('Calendar'))

 

When I include the measure in a table it throws an error saying that the DATEADD function needs contiguous data. I was hoping that the use of the Calendar table would get around this issue but it is failing.

Is anyone able to help guide me on a way to achieve the what if scenario on the expiry dates?

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Morton041740 -

A couple troubleshooting possibilities:

1. Does the calendar table have any gaps?

2. Try using expiry date as the Enabled relationship and see whether a simpler version of the measure works.

Hope this helps,

Nathan

View solution in original post

1 REPLY 1
Anonymous
Not applicable

@Morton041740 -

A couple troubleshooting possibilities:

1. Does the calendar table have any gaps?

2. Try using expiry date as the Enabled relationship and see whether a simpler version of the measure works.

Hope this helps,

Nathan

Helpful resources

Announcements
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.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

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