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
KeithChu
Helper I
Helper I

Getting today's sales and last month's today's sales

Hi experts,

 

I created a measure to calculate today's sales. Something like CALCULATE(SUM('Sales'[Sales Amount], FILTER('Calendar', [Date] = MAX('Sales'[Doc Date])).

 

Now I would like to get last month's today's sales. But I cannot use Dateadd like I did in ssrs because for whatever reason it doesn't want scalar value. Can you help me on this? Thank you.

1 ACCEPTED SOLUTION
Phil_Seamark
Employee
Employee

Hi @KeithChu

 

Does this work?

 

 CALCULATE(SUM('Sales'[Sales Amount]), FILTER('Calendar', EDATE([Date],1) = MAX('Sales'[Doc Date])))

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

View solution in original post

1 REPLY 1
Phil_Seamark
Employee
Employee

Hi @KeithChu

 

Does this work?

 

 CALCULATE(SUM('Sales'[Sales Amount]), FILTER('Calendar', EDATE([Date],1) = MAX('Sales'[Doc Date])))

To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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