Introduction
In the
previous article, I have explained some Time Intelligence Functions that are used in Power BI in the DAX formula. We have more than 30 such functions out of which I have explained 15 functions in my last uploaded article. I will cover the rest of all those functions here in this article.
LASTDATE
Returns last nonblank date.
Syntax - LASTDATE(Date)
Date - A date column
Ex.
LASTNONBLANK
Returns the last value in the column for which the expression has a non-blank value. It returns a
Syntax - LASTNONBLANK(ColumnName, Expression)
ColumnName - A column expression.
Expression - An expression evaluated for blank for each value of the column.
Ex.
NEXTDAY
Returns the next day. This function returns a table that contains the column of all dates from the next day.
Syntax - NEXTDAY(Date)
Date - A date column
Ex.
NEXTMONTH
Returns a table containing a single column of dates from the next month.
Syntax - NEXTMONTH(Dates)
Date - A date column.
Ex.
NEXTQUARTER
Returns a table of a single column of all dates in the next quarter.
Syntax - NEXTQUARTER(Dates)
Dates - A date column
Ex.
NEXTYEAR
Returns a table of a single column of all dates in the next year.
Syntax - NEXTYEAR(Dates)
Date - A date column
Ex.
OPENINGBALANCEMONTH
Evaluates the specified expression for the date corresponding to the end of the previous month after applying specified filters.
Syntax - OPENINGBALACEMONTH (Expression, Dates, [Filter])
Expression - It returns a scalar value
Date - A date column
Filter - A filter expression applies to the current context.
Ex.
OPENINGBALANCEQUARTER
Evaluates the specified expression for the date corresponding to the end of the previous month after applying specified filters.
Syntax - OPENINGBALANCEQUARTER(Expression, Dates, [Filter])
Expression - It returns a scalar value
Date - A date column
Filter - A filter expression applies to the current context.
Ex.
OPENINGBALANCEYEAR
Evaluates the specified expression for the date corresponding to the end of the previous YEAR after applying specified filters.
Syntax - OPENINGBALANCEQUARTER(Expression, Dates, [Filter])
Expression - It returns a scalar value
Date - A date column
Filter - A filter expression applies to the current context.
Ex.
PARALLELPERIOD
Returns a table of a single column contains a parallel period of dates by a given set of dates and specified intervals.
Syntax - PARALLELPERIOD(Dates, NumberOfInterval, Interval)
Dates - A date column.
NumberOfInterval - An integer number that can add or subtract from the given dates.
Interval-it can be ‘Year’, ‘Quarter’, ‘Month’ or ‘Day’.
Ex.
PREVIOUSDAY
Returns a table that contains a single column of a previous day.
Syntax- PREVIOUSDAY(Date)
Date- A date column
Ex.
PREVIOUSMONTH
Returns a table that contains a single column of a previous month.
Syntax - PREVIOUSMONTH(Date)
Date - A date column
Ex.
PREVIOUSQUARTER
Returns a table that contains a single column of a previous month.
Syntax - PREVIOUSMONTH(Date)
Date - A date column
Ex.
PREVIOUSYEAR
Returns a table that contains a single column of a previous month.
Syntax - PREVIOUSYEAR(Date)
Date- A date column
Ex.
SAMEPERIODLASTYEAR
Returns a set of dates in the current selection from the previous year
Syntax- SAMEPERIODLASTYEAR(Date)
Date- A date column
Ex.
Summary
I hope you are now able to understand the intelligence functions of Power BI. Thanks for reading this article!