Forum Discussion

ebrownretail's avatar
ebrownretail
Resolver I
2 years ago
Solved

Calculate WOS based on current month

Hi! I am trying to calculate the WOS for my items by store based on the prior week sales.    I have the prior week sales already as a measure and it works. I am running into an issue when i try to...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Thanks for the reply from miTutorials and SachinNandanwar , please allow me to provide another insight:


    Hi, ebrownretail .

    Regarding the issue you raised, my solution is as follows:

    You can try using the Format() function to convert the date type to the text type.

    1.First I have created the following table and the column names and data are the data you have given:
     

     


    2. Below are the measure I've created for your needs:

    Measure = MAX('Table'[Month])=FORMAT(MAX('Table 2'[Date]),"mmmm")
    Measure 2 = FORMAT(MAX('Table 2'[Date]),"mmmm")

    3.Here's my final result, which I hope meets your requirements.
     

     

     

    4.Here is the relevant documentation:
    FORMAT function (DAX) - DAX | Microsoft Learn

    Of course, if you have any new ideas, you are welcome to contact us.

    Please find the attached pbix relevant to the case.
     

    Best Regards,

    Leroy Lu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.