The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello Everyone,
I have a table that has a list of dates, and I would like to create a new column that goes through and finds the most recent date listed within every month for each year.
Here is an example of what I would like to do:
2/10 is the most recent day listed in Feb of 2020 so it receives a 1 and March 31 is the most recent day in March of 2020 so it receives a 1.
Any advice would be greatly appreciated, thanks!
Solved! Go to Solution.
[Is Most Recent...] = // calculated column
var CurrentDate = T[Date to Check]
var MonthStart = EOMONTH( CurrentDate, -1 ) + 1
var NextMonthStart = EOMONTH( CurrentDate, 0 ) + 1
var Result =
CurrentDate = MAXX(
filter(
T,
MonthStart <= T[Date to Check]
&&
T[Date to Check] < NextMonthStart
),
T[Date to Check]
)
return
1 * Result
[Is Most Recent...] = // calculated column
var CurrentDate = T[Date to Check]
var MonthStart = EOMONTH( CurrentDate, -1 ) + 1
var NextMonthStart = EOMONTH( CurrentDate, 0 ) + 1
var Result =
CurrentDate = MAXX(
filter(
T,
MonthStart <= T[Date to Check]
&&
T[Date to Check] < NextMonthStart
),
T[Date to Check]
)
return
1 * Result
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
58 | |
32 | |
20 | |
16 | |
15 |
User | Count |
---|---|
79 | |
32 | |
30 | |
24 | |
21 |