Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
This is what I have hard coded in Query Editor currently for my start and end dates, and I would like to base them off of fact table min and max dates.
StartDate = #date(2012, 1, 1),
EndDate = Date.From(DateTime.LocalNow()) ,
Thank you for your help
Solved! Go to Solution.
Power Query:
= #table(type table[Date = date],List.Zip({List.Dates(List.Min(Fact[Date]),1+Duration.Days(List.Max(Fact[Date]) - List.Min(Fact[Date])),#duration(1,0,0,0))}))
I create my date tables using DAX
In the modeling tab, select New Table, then enter the DAX similar to the below
DateTable =
ADDCOLUMNS (
CALENDAR (MINX('FactTable',[Transaction Date]), MAXX('FactTable',[Transaction Date])),
"Year", YEAR ( [Date] ),
"QuarterOfYear", FORMAT ( [Date], "Q" ),
"MonthOfYear", FORMAT ( [Date], "MM" ),
"DateInt", FORMAT ( [Date], "YYYYMMDD" ),
"MonthName", FORMAT ( [Date], "mmmm" ),
"MonthInCalendar", FORMAT ( [Date], "mmm YYYY" ),
"QuarterInCalendar", "Q" & FORMAT ( [Date], "Q" ) & " " & FORMAT ( [Date], "YYYY" ),
"DayInWeek", WEEKDAY ( [Date] ),
"DayOfWeekName", FORMAT ( [Date], "dddd" ),
"DayOfWeekShort", FORMAT ( [Date], "ddd" ),
"YearMonthShort", FORMAT ( [Date], "YYYY/mmm" ),
"YearMonthSort", FORMAT ( [Date], "YYYYMM" ),
"Month", FORMAT ( [Date], "mmm" ))
When I have more time, I could work on converting the rest of my Date Fields to DAX so I could use your logic. It is more straight forward than using Power Query. Thanks.
Power Query:
= #table(type table[Date = date],List.Zip({List.Dates(List.Min(Fact[Date]),1+Duration.Days(List.Max(Fact[Date]) - List.Min(Fact[Date])),#duration(1,0,0,0))}))
Thank You!
User | Count |
---|---|
139 | |
113 | |
103 | |
73 | |
63 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |