Introduction to DAX in Power BI
Jess Ahmet
Content Developer, DataCamp
Example Date: 2020/09/20 12:52
Date and Time Functions
YEAR(<date>)
> 2020QUARTER(<datetime>)
> 3MONTH(<datetime>)
> 9Format Function
FORMAT(<date>, <"dddd">)
> FridayFORMAT(<date>, <"h:nn:ss">)
> "12:52:00"Time Intelligence Functions
LASTDATE()
DATESBETWEEN()
DATEADD()
Issues of relying on only dates from transactional tables:
Benefits:
Types of Analysis:
CALENDAR()
CALENDAR(<start_date>, <end_date>)
CALENDAR('2020-01-01', '2020-12-31')
CALENDAR()
CALENDAR(<start_date>, <end_date>)
CALENDAR('2020-01-01', '2020-12-31')
Date |
---|
2020-01-01 |
2020-01-02 |
... |
2020-12-31 |
CALENDARAUTO()
CALENDARAUTO(<fiscal_year_end_month>)
CALENDAR()
.CALENDARAUTO(12)
CALENDARAUTO()
CALENDARAUTO(<fiscal_year_end_month>)
CALENDAR()
.CALENDARAUTO(12)
Date |
---|
2020-01-01 |
2020-07-31 |
... |
2020-12-31 |
Introduction to DAX in Power BI