March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I'm trying to add a custom column to my table that would dynamically list the days of last month.
Example:
In October the table would have rows:
In November:
I've been drilling into the Date functions (documented here) but can't see one that would cater to this requirement.
Is this function possible?
Solved! Go to Solution.
I ended up merging both queries based on the date column. After expanding the merge, filtering some blank/"null" rows, removing duplicates and filtering appropriately I was able to cobble together my solution.
@Anonymous,
What is the correct answer for when the previous month exceeds the current month, e.g. Nov has 30 days where Oct has 31? Also notice rows 30 & 31 where Sept 30 is repeated.
Did you try Date.AddMonths ( )?
Of course I am presuming you have a Date column with a contiguous date range.
Custom Column = Date.AddMonths ( [Date], -1 )
Proud to be a Super User!
I don't currently have a column of the current month. I'm happy to add whatever else I need to make this work though.
Edit: I should state that I don't know of a function that just lists all of the days of the current month. I anticipate the same issue you raised for months when there are 30 vs 31 days and using a function that is (date) - 1.
The issue I'm trying to solve is that I have 2 sets of data, with no unique fields to create a relationship. So I was trying to create some sort of "joiner" table of data that could hold unique dates and relate those to the duplicate dates in each other table.
I suppose another thing I could investigate is copying a column from another table and just removing duplicates. Bit hacky but it might serve..
I ended up merging both queries based on the date column. After expanding the merge, filtering some blank/"null" rows, removing duplicates and filtering appropriately I was able to cobble together my solution.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
86 | |
73 | |
57 | |
52 |
User | Count |
---|---|
201 | |
137 | |
108 | |
73 | |
68 |