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
Trist
Frequent Visitor

Date add issue

Hi Everybody,

ı have an ıssue about date . ı am tryıng to calculate order sales for respective dates. such as below;

productıdtotal sales-01.01.2021total sales-01.02.2021total sales-01.03.2021
110010005000
22001502000
33004503000
48008004500

ı 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 3
v-xulin-mstf
Community Support
Community 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

Anonymous
Not applicable

@Trist 

 

Before you start doing anything in PBI and DAX, you should read THIS. Your data is in a wrong shape for analysis in a tabular model.

sayaliredij
Super User
Super User

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?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.