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

DAX SALES OF THE LAST X MONTHS

I need to get the sales of the last 60 days using dax, could anyone help me?

I have tested several ways but without success.

 

Thank you

1 ACCEPTED SOLUTION
Washivale
Resolver V
Resolver V

Hi,

 

you can try below:

 

last 60 days sales =Calculate(sum(Sales[amoujnt]),Sales[date]<=Today()-60)

 

Or 

 

last 60 days sales =Calculate(sum(Sales[amoujnt]),Sales[date]<=Max(sales[date])-60)

View solution in original post

2 REPLIES 2
v-huizhn-msft
Employee
Employee

Hi @ricardo_cvo.

There is a similar thread for reference, please review: https://community.powerbi.com/t5/Desktop/Rolling-7-Dates-based-on-selected-date-in-dropdown/m-p/1344....

Best Regards,
Angelia

Washivale
Resolver V
Resolver V

Hi,

 

you can try below:

 

last 60 days sales =Calculate(sum(Sales[amoujnt]),Sales[date]<=Today()-60)

 

Or 

 

last 60 days sales =Calculate(sum(Sales[amoujnt]),Sales[date]<=Max(sales[date])-60)

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.