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.
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!
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 |
---|---|
106 | |
94 | |
77 | |
65 | |
53 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |