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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

DATEADD not aggregating

Hello,

I'm trying to create a measure where I calculate revenue recognized on a sales order in specific timeframes (see below table).  I'm using two measures calculating revenue then % of revenue against total sold.

My issue is this measure works when I have the data filtered to one sales order but when I try to apply to my project type (groups) I get the contiguous selection error. It specifically references the first measure that sums the revenue by period, "Calculation error in measure 'Measure'[3 months]: Function 'DATEADD' expects a contiguous selection...".

 

It seems to me that the measure is not aggregating and I can't figure out how to write it to do so.  I am referencing two different tables 'Bookings' and 'Revenue' in my variable and my return.  Both of these tables have their own date table which may be the issue.

 

Goal

Percent Revenue Converted by Period    
Project TypeTotal Order Value3 month6 month9 month
Net New119,025,04532%44%89%
Upgrade6,749,00042%68%74%
Add-on61,386,74150%59%92%
Other3,253,57960%79%94%

 

Currently DAX is set up as follows:

Revenue:

3 months =
VAR threemonths = DATEADD(Bookings[Order Intake Date],3,MONTH)
RETURN
CALCULATE([Sum Revenue Recognized], Revenue[Posting Date] <= threemonths)
 
% Converted = CALCULATE(DIVIDE('Measure'[3 months],[Sum Order Value]))
 
Again the above works when referencing a single sales order example
Order NumberTotal Order Value3 Month6 Month9 Month
30033566$274,85928.59%46.42%74.95%
 
TIA
3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi @Anonymous 

You need  a dim date table and then use it with Time Intelligence function in dax

https://radacad.com/do-you-need-a-date-dimension

 

If you still have the problem, please share your sample pbix file and your expected output.

 

Regards,

Lin

 

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

@Anonymous , Try like

Revenue:
var _book =Bookings[Order Intake Date]
3 months =
VAR threemonths = DATE(year(_book),month(_book) +3,day(_book))
RETURN
CALCULATE([Sum Revenue Recognized], Revenue[Posting Date] <= threemonths)

% Converted = CALCULATE(DIVIDE('Measure'[3 months],[Sum Order Value]))

Anonymous
Not applicable

Thanks @amitchandak 

So when I try to use 

var _book = Bookings[Order Intake Date] it won't let me reference the column

 

It says a single value for column 'Order Intake Date' in table 'Bookings' cannot be determined.  

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.