Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I need to obtain the difference of a value between the row's date and the previous working day, for each project:
PROJECT - DATE - VALUE (on date)- Difference (of Value) from the last working date
I assume that the first step is obtaining the table:
DATE - PREVIOUS WORKING DATE to merge with the table with values.
I have managed to get it in DAX, as an added column in Power BI, but I need to convert it into M to add the column to the query. The sintax I have used and which works is:
Previous working day=
MAXX(
FILTER (Dates, Dates[Dateslist] < EARLIER(Dates[Dateslist])
&& WEEKDAY(Dates[Dateslist];3) <5);
DATES[Dateslist])
Any inspiration on the best way to do this is more than welcome!
Thanks!
María
Solved! Go to Solution.
Hi @Anonymous
Try these 2 custom Columns
First add a column for weekday
Date.DayOfWeek([Dateslist],1)+1
Now a column for PreviousWorking Day
let mydate=[Dateslist] in List.Max( Table.SelectRows(AddedCustom,each [Dateslist] < mydate and [DayofWeek] <6)[Dateslist] )
AddedCustom above is reference to previous step
Hi @Anonymous
Try these 2 custom Columns
First add a column for weekday
Date.DayOfWeek([Dateslist],1)+1
Now a column for PreviousWorking Day
let mydate=[Dateslist] in List.Max( Table.SelectRows(AddedCustom,each [Dateslist] < mydate and [DayofWeek] <6)[Dateslist] )
AddedCustom above is reference to previous step
@Anonymous
Please see attached excel file's Query Editor for above steps
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
94 | |
77 | |
63 | |
50 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |