Forum Discussion
Date add issue
Hi Everybody,
ı have an ıssue about date . ı am tryıng to calculate order sales for respective dates. such as below;
| productıd | total sales-01.01.2021 | total sales-01.02.2021 | total sales-01.03.2021 |
| 1 | 100 | 1000 | 5000 |
| 2 | 200 | 150 | 2000 |
| 3 | 300 | 450 | 3000 |
| 4 | 800 | 800 | 4500 |
ı have an date filter which is equal to 'Dim_Date'[date] . when ı select 01.01.2021 as date filter, ı want to see to 01.02.2021, 01.03.2021 respectively in fields. so when ı try to add one month to measure ı fail. could you help please?
measure:
TotalSales = CALCULATE(
SUM('order'[sales])
,FILTER('Dim_Date'[date] <= ['sales'[date]))
note: ı tryed datediff and dateadd but ıt doesnt work ı dont know why.
3 Replies
- sayaliredijSolution Sage
is your table structure same as shown above?
I think it would be best if we have table structure as below
Product Id Date Sales
1 01.01.2021 100
1 01.02.2021 200
1 01.03.2021 500
then you can make connection with date table and have filtering like you wanted.
Does this make sense?
- AnonymousNot applicable
- v-xulin-mstfCommunity Support
Hi Trist,
Could you provide your pbix file after removing sensitive information?
Maybe you can change data structure in query editor and the apply the measure.
Best Regard,
Link