cancel
Showing results for
Search instead for
Did you mean:
Highlighted
Regular Visitor

## DAX: Need help with Weeks of supply calculation

Hi,

I am working on a DAX solution, where I would need to see the result in the below format.
I would like to see how many weeks it takes for the forecast to run out based on the on-hand value. I have rounded the weeks in the result.

Thanks for the help
Latha

5 REPLIES 5
Highlighted
Super User II

## Re: DAX: Need help with Weeks of supply calculation

what's a logic for your Result?

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Highlighted
Regular Visitor

## Re: DAX: Need help with Weeks of supply calculation

I am checking how many weeks it takes the sum of the forecast to reach on-hand value.
Example: In the first row, on-hand is negative so I would need to get 0.
for the second row, 6 weeks of forecast (733+733+857+857+857+3099) is required to get the on-hand 6399.
Please let me know if you further have any question.

Highlighted
Super User II

## Re: DAX: Need help with Weeks of supply calculation

it's unclear for me why exactly 6 weeks for second row.

and to be clear, you need DAX for new Result column (highlited as yellow) or for SUM 733+733+857+857+857+3099 ?

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Highlighted
Regular Visitor

## Re: DAX: Need help with Weeks of supply calculation

I want to do the calculation for the results column highlighted. And to clarify, I am counting the number of forwarding forecast rows needed to sum to equal the ending on-hand value. 6 is a rounded value in the above example, but the actual value would be 5. 6 approx.

Highlighted
Regular Visitor

## Re: DAX: Need help with Weeks of supply calculation

I was able to solve this problem. thanks.

## Helpful resources

Announcements

#### August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

#### July 2020 Community Highlights

Learn about the exciting things that happened in July.

#### Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

#### Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors