Forum Discussion
dkay84_PowerBI
Microsoft Employee
10 years agoDate Dimension Table that Dynamically Pulls Start and End dates from a Column of Dates
As the title suggests, I am looking to create a date dimension table with M that checks for the earliest and most recent invoice dates and creates a date table from that with 1 day increments. I hav...
dkay84_PowerBI
Microsoft Employee
10 years agoAdditionally, you can create a calculated table (under "modeling" tab), using the dax expression Calendar(start date, end date), where start and end date are calculated using dax (min and max of sales[dates] while ignoring filters). From here, you will have to build out the steps the M code above performed, and configure data types and formatting, and create the relationship between this dates table and the sales table.
This way seems much easier, not sure why I couldn't find this out earlier in my search. At the moment, I don't have the specific dax expression to calculate min and max while ignoring applied filters.
Anonymous
10 years agoNot applicable
Something like below?
First Invoice Date = CALCULATE(MIN(Invoices[OrderDate]),ALL('Invoices'))
Last Invoice Date = CALCULATE(MAX(Invoices[OrderDate]),ALL('Invoices'))