Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7014345
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:30:34+00:00 2026-05-27T22:30:34+00:00

I am building a cube in SSAS that uses inventory movement data to show

  • 0

I am building a cube in SSAS that uses inventory movement data to show item activity. A sample of this data can be seen here (hopefully this is readable).

Date = Customer = Item = Receive Qty = Ship Qty = Movement

1/1/2000 = Cust123 = Item123 = 100 = 0 = 100

11/5/2011 = Cust123 = Item123 = 10 = 0 = 10

11/6/2011 = Cust123 = Item123 = 0 = -5 = -5

11/7/2011 = Cust123 = Item123 = 1 = 0 = 1

The goal is to include an opening balance in the cube. The opening balance for a given date is defined as the sum of all Movement (from the Movement field) for a given customer and item (my fact table contains many different customers and items) for all dates prior to the current date.

So in the sample data, the opening balance for the 11/6/2011 date would be the sum of all Movement (from the Movement field) where the customer and item are a match, and the date is less than 11/6/2011. Which would go all the way back to 1/1/2000 in my sample data.

Is there a way that MDX could help me accomplish this in my cube? I am relatively new to SSAS, but I believe there should be a way for me to include some MDX in the Calculations tab correct? Any help would be greatly appreciated. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:30:34+00:00Added an answer on May 27, 2026 at 10:30 pm

    A quick dirty way would be:

    sum({null:[Date].[Date Hierarchy].CurrentMember.Lag(1)}, [Measures].[Movement])
    

    This assumes a few things:

    1. Your CurrentMember of the Date Hierarchy will be at a day level.
    2. Your dataset isn’t that big that this sum can be undertaken very quickly.

    If you have a much larger dataset and this is slow for you, what you’ll want to do is to sum up the previous months (or years, depending on your partition level) first, and then do days of this month on top of it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am building a Mondrian Cube that shows information for a large range of
building a site using PHP and MySQL that needs to store a lot of
Building a website that has English & Japanese speaking users, with the Japanese users
I have an application that I know would make a great cube and would
Building a sample ASP.NET MVC app. Using the Membership API for authentication. For whatever
Building a commercial product may use various open source libraries that have use of
Building our Android app from Ant fails with this error: [apply] [apply] UNEXPECTED TOP-LEVEL
I'm building a BI dashboard for my client. Our data is stored in an
Building my first WP theme and I quickly realized that I need to remove
Building a rails B2B application that will have various users. I'm pretty clear on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.