Forum Discussion

Mostafa-Hussien's avatar
2 years ago

Inventory Transaction Dates do not respond

Hi

I have a very complicated inventory table in the database that I want to calculate the on-hand grouped by many dimensions. I am struggling to get it correctly. So I decided to breakdown the problem

 

My first issue (the subject of this post)

We have two dates columns. STOREACTIONITEMDATE is when an action takes place generally and STOREADDITIONDATE is specifically used for incoming items. Whenever there is a sale for example the STOREADDITION is empty because this is not incoming items, while the STOREACTIONITEMSDATE is filled with the date of the sale.

 

How can I pull the STOREADDITIONDATE into the same row of the STOREACTIONITEMSDATE is something I have tried several hours and failed to reach

 

Any help ?

 

 

3 Replies

  • The usual approach would be to use COLALESCE to automatically use the first available value.

  • ahadkarimi's avatar
    ahadkarimi
    Icon for Solution Specialist rankSolution Specialist

    Hi Mostafa-Hussien, create a new column:

     

    AddDate = 
    IF(
        ISBLANK(Test15[STOREADDITIONDATE]),
        Test15[STOREACTIONITEMSDATE],
        Test15[STOREADDITIONDATE]
    )

     

    or create a measure:

     

    AddDate = 
    CALCULATE(
        MAXX(
            ALLSELECTED(Test15),
            IF(
                ISBLANK(Test15[STOREADDITIONDATE]),
                Test15[STOREACTIONITEMSDATE],
                Test15[STOREADDITIONDATE]
            )
        )
    )

     

     

     

    Did I answer your question?  If so, please mark my post as the solution!✔️
    Your Kudos are much appreciated!  Proud to be a Responsive Resident!

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi, Mostafa-Hussien 

    May I ask if you have gotten this issue resolved? If it is solved, please share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.

     

    If it is not resolved, I hope you will provide the full .pbix file via OneDrive or SharePoint. Please be careful to remove all sensitive information and we will do our best to provide ideas for your issue.

     

     

     

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
    Best Regards,
    Fen Ling,
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.