Forum Discussion
Convert DAX to M
- 6 years ago
Hey Arnault_ ,
first I had to convert the values from the column TS05_packing_date into something that my Power Query was able to recognize as a date, this means my table looks like this:
Here is my solution that is based on two steps:
1. Determinig the min date per order_id
For this I grouped the table by order_id, but also added the aggregation function "All Rows"
After expanding the group my table looks like this:
2. Adding a custom column to check the date
I added a custom column "checkFirstDate" using this M expression:
if [TS05_packing_date] <= Date.AddDays([MinDate], 😎 then "yes" else "no"Finally the table looks like this, of course the the column "MinDate" can be deleted from the table as an additional step:
Hopefully this provides you with some ideas, how to tackle your requirement.
Regards,
Tom
Hey Arnault_ ,
first I had to convert the values from the column TS05_packing_date into something that my Power Query was able to recognize as a date, this means my table looks like this:
Here is my solution that is based on two steps:
1. Determinig the min date per order_id
For this I grouped the table by order_id, but also added the aggregation function "All Rows"
After expanding the group my table looks like this:
2. Adding a custom column to check the date
I added a custom column "checkFirstDate" using this M expression:
if [TS05_packing_date] <= Date.AddDays([MinDate], 😎 then "yes" else "no"
Finally the table looks like this, of course the the column "MinDate" can be deleted from the table as an additional step:
Hopefully this provides you with some ideas, how to tackle your requirement.
Regards,
Tom
Hello. Can anyone help me convert the following dax code to M query? I have a dataset where "value" is cumulative for a year i.e. YTD. I need monthly value so that I can append this dataset to another table with the same variables where value is "monthly" and NOT YTD. Thank you