Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Deva002
Frequent Visitor

DAX Last Year Sales Division wise

How to add a calculated column for the last year sales for the same month divison wise?

DivDateSales

A01/01/2015100
A01/01/2014200
A01/01/2016300
B01/01/2015150
B01/01/2014250
B01/01/2016350
1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

 

hi @Deva002

 

try with this:

 

LastYearSales = CALCULATE(Sum(Sales[Sales]),ALLEXCEPT(Sales,Sales[Div]),DATEADD(Sales[Date],-1,YEAR))

 

 




Lima - Peru

View solution in original post

2 REPLIES 2
Vvelarde
Community Champion
Community Champion

 

hi @Deva002

 

try with this:

 

LastYearSales = CALCULATE(Sum(Sales[Sales]),ALLEXCEPT(Sales,Sales[Div]),DATEADD(Sales[Date],-1,YEAR))

 

 




Lima - Peru

Thanks Victor. 🙂

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.