Forum Discussion

Devender9999's avatar
Devender9999
Frequent Visitor
3 years ago

Revenue Calculations based on dates from another table

Hi,

I have two fact table one is Sales Table and other is Opportunity which has data of those customer and material which can become sales 

The modeling is 

Customer master /Material tables are connected to Sales table and to Opportunity table 

Now I am creating a table visual where having customer, material and opportunity close date and sales from sales table but to do that i have a condition that calculated sales from sales table when sales invoice date > opp closed date and before end date of the same year

But 
Dax which i am using 
Var _closedate = max(opp close date)
Var _enddateyear = date(year(_closedate),12,31)
return
calculate(sum(sales),invoice date>_closedate && invoice date<=_enddateyear)

Is not working 
I tried by created calculatetable function as well but didnt get.

can anyone please suggest something???

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Devender9999 ,

    In order to better understand your demands and give the right solution, could you please provide some more specific information? such as your desensitized example data and a screenshot of your desired results?

    Thanks for your efforts & time in advance.

     

    Best regards,
    Community Support Team_Binbin Yu