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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
sktwr61622
New Member

How to get the total sales for the previous year > than a given amount

I need help to figure out how to display the total sales for the previous year based on the slicer which is current year and the sales for the previous year must be greater than a certain amount

I have 2 tables: a date table and a Sales table

Sales Table

SalesRep Date Amount
101 2022-01-15 250
102 2022-01-25 500
101 2022-02-10 1,000
102 2022-02-20 100
103 2022-02-22 5,000
101 2021-01-10 2,000
102 2021-01-15 200
101 2021-02-11 4,000
102 2021-02-10 200
103 2021-02-12 6,000

I have a date slicer set for 2022-01-01 to 2022-02-28 and this is the only slicer on the report

I want to find the total sales for last year for the same time period as the slicer and the total amount for each sales rep > 3,000 and then sum all the records that meet the criteria

The interim result if I will to sum it by year will be

Var SLS = SUM('Sales'[Amount])

CALCULATE([SLS], SAMEPERIODLASTYEAR('DIM_Date'[DTE_Date]))

Sales Rep Year Amount
101 2022 1,250
102 2022 600
103 2022 5,000

101 2021 6,000
102 2021 400
103 2021 6,000

Since only sales rep 101 and 102 > 3,000 for the previous year, I want the result and exclude 102 since it is < 3,000

My final answer should be for previous year = 12,000

Thank You in advance for your assistance

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

I tried to create a sample pbix file like below.

All measures are in the attached pbix file.

 

Untitled.pngUntitled2.png

 

Current year sales: = 
SUM( Data[Amount] )

 

Previous year same period sales: = 
CALCULATE ( [Current year sales:], DATEADD ( 'Calendar'[Date], -1, YEAR ) )

 

P.Y same period sales by the conditoin: = 
SUMX (
    FILTER (
        VALUES ( SalesRep[SalesRep] ),
        [Previous year same period sales:] > 3000
    ),
    [Previous year same period sales:]
)

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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I am not sure if I understood your question correctly, but please check the below picture and the attached pbix file.

I tried to create a sample pbix file like below.

All measures are in the attached pbix file.

 

Untitled.pngUntitled2.png

 

Current year sales: = 
SUM( Data[Amount] )

 

Previous year same period sales: = 
CALCULATE ( [Current year sales:], DATEADD ( 'Calendar'[Date], -1, YEAR ) )

 

P.Y same period sales by the conditoin: = 
SUMX (
    FILTER (
        VALUES ( SalesRep[SalesRep] ),
        [Previous year same period sales:] > 3000
    ),
    [Previous year same period sales:]
)

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.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Thank You so much. The solution worked.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.