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
Vijay_patel
New Member

Calculate last 3 month max sales

Hi,

Please can someone help to figure out , how to calculate, max sales in last 3 months?.

I have colum of ship date, product , sold qty,

the shipping date is in days

 

THanks in advance.

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi, 

I am not sure if I understood your question correctly, but I tried to create a sample pbix file like below.

Please check the below picture and the attached pbix file.

I hope the below can provide some ideas on how to create a solution for your datamodel.

 

Jihwan_Kim_0-1684089957254.png

 

Jihwan_Kim_1-1684090293783.png

 

Max qty in last 3 months: =
IF (
    HASONEVALUE ( 'Product'[Product] ),
    MAXX (
        DATESINPERIOD ( 'Calendar'[Date], LASTDATE ( 'Calendar'[Date] ), -3, MONTH ),
        [QTY total:]
    )
)

 

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Go to My LinkedIn Page


Hi there,

thanks for looking into this, but I have different data. If you can help me to amend below code to get desired results.

below codes sums the last 3 months sales whereas I need max qty

sokd in last 3 month.

image.jpg

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.