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
webportal
Impactful Individual
Impactful Individual

Calculated column - last 365 days sales

I'm trying to create a calculated column with the sales of the last 365 days:

 

Sales365D =
VAR EsteCLiente = 'customerSales'[CustomerID]
VAR EstaData = 'customerSales'[Date]
VAR DataAnterior = DATE(YEAR(EstaData)-1, MONTH(EstaData), DAY(EstaData))
RETURN
CALCULATE (
SUM ( customerSales[Sales] ),
FILTER (
ALL ( customerSales ),
customerSales[CustomerID] = EsteCLiente &&
'customerSales'[Date] > DataAnterior &&
'customerSales'[Date] <= EstaData
)
)
 
But why is this returning the wrong value for 20-12-2018?
 
webportal_0-1619596200659.png

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@webportal , To me, it seems correct, check for some decimal place. Increase the decimal place in column tools and check

 

else

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

View solution in original post

2 REPLIES 2
webportal
Impactful Individual
Impactful Individual

It is correct ...
😁

amitchandak
Super User
Super User

@webportal , To me, it seems correct, check for some decimal place. Increase the decimal place in column tools and check

 

else

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

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.