Forum Discussion

Giswald's avatar
Giswald
Frequent Visitor
5 years ago

Get latest Value until week

Hi I run into one problem at work here and through hours of googling and video-watching I could not find any answer that fit me.

 

I have a Customer-Article-Date-InStock Table:

CustomerIDArticleIDDateInStock
1127.07.20211
1128.07.20210
1113.07.20211

 

 

From the Date I know the week numbere.

The "InStock" should be summarized per week. If no matching value is found for this week take the previous one (Could be any week before this).

So basically this is a change table and not a fact table.

 

I would expect:

Week 28: 1

Week 29: 1

Week 30: 0

 

How can I do this?

2 Replies

  • Have a separate (disconnected) dates table with the week ranges and then do a cross join between it and your not-a-facts table to drive the measures.  You may want to provide some more sample data and indicate the expected result so the premise is clearer.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Giswald 

    I don't quite understand the expected results you provided. What do you mean by no matching value ? How to judge ? Can you provide a more detailed data or pbix file to help us deal with problems better ?

     

    Best Regards

    Community Support Team _ Ailsa Tao