Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Kumail

New Functions in DAX in 2022

What is DAX?

Data Analysis Expressions (DAX) is a formula expression language used in Analysis Services, Power BI, and Power Pivot in Excel. It is a programming language that is used throughout Microsoft Power BI for constructing calculated columns, measures, and custom tables. It is a compilation of functions, operators, and constants that can be utilized in a formula, or expression, to calculate and return one or more values.

You can easily alter your data model by using DAX to solve a number of calculations and analysis problems.

DAX in Power BI:

 

#Dax #PowerBI#Dax #PowerBI

 

 

DAX formulas are very handy in BI tools like Power BI as they help data analysts to use the data sets, they have to the deepest potential.

With the help of the DAX language, analysts can discover different ways to calculate data values they have and come up with creative insights. It is really very easy to generate smooth reports in Power BI with just few knowledge of BI software and by using functionalities of Data importing, functionalities and visualization. 

DAX Recap in 2022

#dax #functions#dax #functions

 

There are number of changes takes place in year 2022. Various new functions were added in the list of DAX functions. Here is a list of few that were added in 2022:

  1. NETWORKDAYS
  2. TOJSON
  3. TOCSV
  4. EVALUATEANDLOG
  5. WINDOW
  6. PARTITIONBY
  7. ORDERBY
  8. OFFSET
  9. INDEX

 

Let’s talk in brief about these functions: 

NETWORKDAYS:

Returns the number of whole working days between start_date and end_date. Working days exclude weekends and any dates identified in holidays. Use NETWORKDAYS to calculate employee benefits that accrue based on the number of days worked during a specific term.

Syntax:

NETWORKDAYS ( <start_date>, <end_date> [, <weekend>] [, <holidays>] 

#DAX #Functions #NETWORKDAYS#DAX #Functions #NETWORKDAYS

TOJSON

Converts the records of a table into a JSON text.

Syntax:

TOJSON(, [MaxRows])

#TOJSON #DAX #PowerBI #Analytics#TOJSON #DAX #PowerBI #Analytics

TOOCSV

Returns a table as a string in CSV format. It converts the records of a table into a CSV (comma-separated values) text.

Syntax:

TOCSV(, [MaxRows], [Delimiter], [IncludeHeaders])

#TOCSV #BI #POWERBI #ANALYTICS#TOCSV #BI #POWERBI #ANALYTICS

EVALUATEANDLOG

Return the value of the first argument and also log the value in DAX evaluation log. This function is fully functional in Power BI Desktop only. It acts as a simple passthrough function in other environments.

Syntax:

EVALUATEANDLOG(<Value>, [Label], [MaxRows])

#EvaluateAndlog #Analytics #PowerBI #DataScience#EvaluateAndlog #Analytics #PowerBI #DataScience

WINDOW

Retrieves a range of rows within the specified partition, sorted by the specified order or on the axis specified.

Syntax:

WINDOW ( from[, from_type], to[, to_type][, <relation>][, <orderBy>][, <blanks>][, <partitionBy>] )

#DAX #Window #POWERBI #Analytics #SQL#DAX #Window #POWERBI #Analytics #SQL

PARTITIONBY

The columns used to determine how to partition the data. Can only be used within a Window function. It defines the columns that are used to partition a window function’s parameter.

Syntax:

PARTITIONBY ( <partitionBy_columnName>[, partitionBy_columnName [, …] ] )

 

ORDERBY

The columns and order directions used to determine the sort order within each partition. Can only be used within a Window function.

Syntax:

ORDERBY ( <orderBy_columnName>[, <order>][, orderBy_columnName [, <order>]] [, …] )

OFFSET

Retrieves a single row from a relation by moving a number of rows within the specified partition, sorted by the specified order or on the axis specified.

Syntax:

OFFSET ( <delta>[, <relation>][, <orderBy>][, <blanks>][, <partitionBy>] )

#Offset #BI #POWERBI #SQL #DAX#Offset #BI #POWERBI #SQL #DAX

INDEX:

Returns a row at an absolute position, specified by the position parameter, within the specified partition, sorted by the specified order. If the current partition can't be deduced to a single partition, multiple rows may be returned. It Retrieves a row at an absolute position (specified by the position parameter) within the specified partition sorted by the specified order or on the axis specified.

Syntax:

INDEX(<position>[, <relation>][, <orderBy>][, <blanks>][, <partitionBy>])

#INDEX #POWERBI #DAX #Analytics#INDEX #POWERBI #DAX #Analytics

 

 

Sum Up:

To sumup this blog Power BI file is attached for your quick reference. Where you can easily explore all the defined functions!! 

Hope you Enjoy!! And Happy learning!!!

 

Kumail Raza








Comments

Thank for sharing