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
John33
Regular Visitor

Last Year calculation from measures that contains filter

Dear BI experts, 

 

I'm stucked in a situation for 2 days and after a lot of research I couldn`t solve my issue. (My apologize if there is an easy solution for that)

 

I created a measure which result is the sum of moves from a filtered table with 2 criterias set by "OR" function, it's working well. 

 

 I also set a "Last Year" measure  in order to stablish a comparison, however when I insert a date slicer and define 2019 period, It's not bringing 2018 values. Is there anyway to have the slicer only applying to the first measure?
 
I also tried using  CALCULATETABLE , but it's not working, it seems to be a filter date problem.
 
Volume Moves for Domestic Full = SUMX(FILTER('CAMS';OR('CAMS'[Product Move Class.Move Type & Category]="LoadLaden";'CAMS'[Product Move Class.Move Type & Category]="DischargeLaden"));[SUMMOVES])


LY Volume Domestic Full = CALCULATE([Volume Moves for Domestic Full];DATEADD('Calendar'[Date].[Date];-1;YEAR))


2help powerbi.PNG

 

Thank you 🙂

 

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @John33 

Can you try removing the second .[date] from you PY measure?  So it would be.

LY Volume Domestic Full = CALCULATE([Volume Moves for Domestic Full];DATEADD('Calendar'[Date];-1;YEAR))

View solution in original post

1 REPLY 1
jdbuchanan71
Super User
Super User

Hello @John33 

Can you try removing the second .[date] from you PY measure?  So it would be.

LY Volume Domestic Full = CALCULATE([Volume Moves for Domestic Full];DATEADD('Calendar'[Date];-1;YEAR))

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.