Dates Difference and other criteria for DAX

Hi Experts,

I am working on analysis for staff members uniforms and want to establish the sizes changes.
Uniforms are issued every 180 days.

I want to create a DAX Measure based on below parameters.

  1. If first issuance date is >= 180 from last issuance date for Trousers
  2. If the Sizes changes between first issuance date and last issuance date it gives me a value “Size Changed”
  3. If not than gives me “Size Not change”

Similar, For Jacket:

  1. If first issuance date is >= 180 from last issuance date for Jacket
  2. If the Sizes changes between first issuance date and last issuance date it gives me a value “Size Changed”
  3. If not than gives me “Size Not change”

For Example:( Trouser)
In the sample dataset:
Staff ID - 123
First Issuance date : 01-01-2017
Last Issuance Date: 25-06-18
Its above 180 days.

Size changed from 10 to 12.
As a result “Size changed”.

Attached Excel sheet and power bi file attached for reference
Size_analysis.xlsx (9.3 KB)
Size_Analysis.pbix (58.9 KB)

Thank you for your guidance and help.

HI @EnanBahadur,

Do you have a date table in your model? All good models needs a date table if you are calculating date difference. EDNA has the best Date table that @Melissa
Here is the link
Extended Date Table (Power Query M function) - Power Query / M Code Showcase - Enterprise DNA Forum

I downloaded your files and noticed that you really didn’t give it a try on the dax formulaes calculations. Where your issues are within the DAX formula?

There are plenty of examples in the courses\youtube

These are just some of the courses on EDNA

Chapgpt might help you dax too but you need check it too
thanks
Keith

1 Like