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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Bhuvaraghan
Frequent Visitor

Getting previous week Value in Sales report

Hi All,

 

I am preparing a sales report where I want to show accounts which moved from one stage to another in the previous week.

WeekStageAccount NamePrevious Week
10/16/2020Proposal SubmittedABC-
10/16/2020DiscoveryXYZ-
10/23/2020Contract NegoticationABCProposal Submitted
10/23/2020DiscoveryXYZDiscovery
10/30/2020WonABCContract Negotication
10/30/2020Proposal SubmittedXYZDiscovery

 

I want to calculate the Previous week column using DAX. Any help is appreciated. If I need to create any helper columns to identify previous week also, I can do.

 

Thanks,

Bhuvaraghan

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Bhuvaraghan , Try a new column like

maxx(filter(table, [Week] = earlier([Week])-7 && [Account ] = earlier([Account ])),[Stage])

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

4 REPLIES 4
Icey
Community Support
Community Support

Hi @Bhuvaraghan ,

 

You can also create a column like so:

Column =
CALCULATE (
    MAX ( 'Table'[Stage] ),
    FILTER (
        'Table',
        'Table'[Account Name] = EARLIER ( 'Table'[Account Name] )
            && 'Table'[Week]
                = EARLIER ( 'Table'[Week] ) - 7
    )
)

 

It works the same as what @amitchandak provided.

 

 

Best regards

Icey

 

If this post helps,then consider Accepting it as the solution to help other members find it faster.

Thanks a lot, worked like a charm 🙂

amitchandak
Super User
Super User

@Bhuvaraghan , Try a new column like

maxx(filter(table, [Week] = earlier([Week])-7 && [Account ] = earlier([Account ])),[Stage])

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thanks a lot for your help 🙂

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.