Forum Discussion
Ranjith_96
3 years agoHelper I
difference between my two DAX
Hi Power BI Community,
Please look at my image below ,
cumulative_sales = CALCULATE(SUM(Orders[Sales]),dim_date[Date]<= MAX(Orders[Order Date]))
I am calculating cumulative sales, which is working fine correctly when I have an relationship with dim_date table and orders table and if i use dim_date column in the formula.
But If I dont have a dim_date table, i am trying to use the order date itself inplace of dim_date, like below , I am not getting the cumulative sum, I am getting the same value as of Total sales for every row,
cumulative_sales = CALCULATE(SUM(Orders[Sales]),Orders[Order Date]<= MAX(Orders[Order Date]))
Can someone explain me, why this is happening. Both the DAX are same only right? or is there any difference. I am trying to understand the difference between both the DAX and the concept behind it. Please help me in understanding it.
Thanks in Advance.
please find the URL of the pbix file for your reference,
Ranjith_96 , as you are using order_date in measure same date has to be used in visual as you are using row context in measure
cumulative_sales1 = CALCULATE(SUM(Orders[Sales]),Orders[Order Date] <= MAX(Orders[Order Date]))
2 Replies
- amitchandakSuper User
Ranjith_96 , as you are using order_date in measure same date has to be used in visual as you are using row context in measure
cumulative_sales1 = CALCULATE(SUM(Orders[Sales]),Orders[Order Date] <= MAX(Orders[Order Date]))- Ranjith_96Helper I
Thanks much amitchandak for your response.