Power BI Dax Function | 14 Categories Dax’s with Syntax

Business Formulas are calculated using DAX Functions (Data Analysis expressions), which are part of Power BI’s unified and scalable platform for self-service and enterprise business intelligence. ADDCOLUMNS, DATESINPERIOD, GROUPBY, SELECTCOLUMN, USERELATIONSHIP, SUMMARIZE, FILTER, FILTERS, RELATED, ALL, ALLEXCEPT, CALCULATE, CALCULATETABLE, SUM (All Aggregated), SUMX (Iterators), and so on are among the most frequently used DAX functions.

power bi dax function

For additional information about power BI, click here. If you’re struggling to optimize your Powe BI reports, click here to explore techniques for improving visualization, data models, ETL, and DAX functions.

The following applications make use of Power BI DAX functions:

    • Microsoft Analysis Services
    • Microsoft Power BI
    • Excel’s Microsoft Power Pivot
DAX Data Type:

Binary, Decimal, Currency, String, Boolean, Datetime, Variant, and Integer are the DAX data types.

DAX Operators:

The parenthesis – () Calculation – +,–,*,/ Comparison – =,<>,<,>,<=,>= Concatenation of text – & Logical – &&, ||, IN, NOT, AND, OR

Conditional Statements:

IF, SWITCH

The list of DAX Functions categories is as follows:

  • Aggregated DAX functions
  • Date and time DAX functions
  • Filter DAX functions
  • Financial DAX functions
  • Information DAX functions
  • Logical DAX functions
  • Math and trig DAX functions
  • Relationships DAX functions
  • Statistical DAX functions
  • Table manipulation DAX functions
  • Text DAX functions
  • Time intelligence DAX functions.

Aggregate Functions in Power BI DAX Functions

The following functions and formulas are available in Power BI:

S.No.FunctionFormulaDescription
1. APPROXIMATEDISTINCTCOUNTAPPROXIMATEDISTINCTCOUNT(<columnName>)Returns an approximate count of distinct values in a column.
2.AVERAGEAVERAGE(<column>)Calculates the arithmetic mean of numbers in a column.
3.AVERAGEA (including non-numeric values)AVERAGEA(<column>)Returns the average of values in a column, including non-numeric values.
4.AVERAGEX (evaluated over a table)AVERAGEX(<table>, <expression>)Calculates the average of an expression evaluated for each row in a table.
5.COUNTCOUNT(<column>)Counts non-blank values in a column.
6.COUNTA (including non-numeric values)COUNTA(<column>)Counts non-blank values in a column, including non-numeric values.
7.COUNTAX (evaluated over a table)COUNTAX(<table>, <expression>)Counts non-blank results of an expression evaluated for each row in a table.
8.COUNTBLANKCOUNTBLANK(<column>)Counts blank cells in a column.
9.COUNTROWSCOUNTROWS([<table>])Counts rows in a table.
10.COUNTX (evaluated over a table)COUNTX(<table>, <expression>)Counts rows containing a number or an expression that evaluates to a number.
11.DISTINCTCOUNTDISTINCTCOUNT(<column>)Counts distinct values in a column.
12.DISTINCTCOUNTNOBLANKDISTINCTCOUNTNOBLANK(<column>)Counts distinct values in a column, excluding blanks.
13.MAXMAX(<column>)Returns the largest numeric value in a column.
14.MAXA (including non-numeric values)MAXA(<column>)Returns the largest value in a column.
15.MAXX (evaluated over a table)MAXX(<table>, <expression>)Evaluates an expression for each row in a table and returns the largest numeric value.
16.MINMIN(<column>)Returns the smallest numeric value in a column.
17.MINA (including non-numeric values)MINA(<column>)Returns the smallest value in a column.
18.MINX (evaluated over a table):MINX(<table>, <expression>)Evaluates an expression for each row in a table and returns the smallest numeric value.
19.PRODUCTPRODUCT(<column>)Returns the product of numbers in a column.
20.PRODUCTX (evaluated over a table)PRODUCTX(<table>, <expression>)Returns the product of an expression evaluated for each row in a table.
21.SUMSUM(<column>)Adds all numbers in a column
22.SUMX (evaluated over a table)SUMX(<table>, <expression>)Returns the sum of an expression evaluated for each row in a table.

Date & Time Functions

The following functions help you work with dates and times in Power BI:

S.No.FunctionFormulaDescription
1.CALENDARCALENDAR(<start_date>, <end_date>)Generates a table with a contiguous set of dates between two specified dates.
2.CALENDARAUTOCALENDARAUTO([fiscal_year_end_month])Automatically generates a table with a contiguous set of dates based on the fiscal year end month.
3.DATEDATE(<year>, <month>, <day>)Returns a specified date in datetime format.
4.DATEDIFFDATEDIFF(<Date1>, <Date2>, <Interval>)Calculates the number of intervals (days, months, etc.) between two dates.
5.DATEVALUEDATEVALUE(date_text)Converts a text date to a datetime format.
6.DAYDAY(<date>)Returns the day of the month (1-31)
7.EOMONTHEOMONTH(<start_date>, <months>)Returns the last day of the month, before or after a specified number of months
8.HOURHOUR(<datetime>)Returns the hour (0-23)
9.MINUTEMINUTE(<datetime>)Returns the minute (0-59)
10.MONTHMONTH(<datetime>)Returns the month (1-12)
11.NETWORKDAYSNETWORKDAYS(<start_date>, <end_date>[, <weekend>, <holidays>])Calculates the number of workdays between two dates
12.NOWNOW ()Returns the current date and time
13.QUARTERQUARTER(<date>)Returns the quarter (1-4)
14.SECONDSECOND(<time>)Returns the seconds (0-59)
15.TIMETIME (hour, minute, second)Converts hours, minutes, and seconds to a time
16.TIMEVALUETIMEVALUE (time_text)Converts a text time to a datetime format
17.TODAYTODAY()Returns the current date
18.UTCNOWUTCNOW()Returns the current UTC date and time
19.UTCTODAYUTCTODAY()Returns the current UTC date
20.WEEKDAYWEEKDAY(<date>, <return_type>)Returns the day of the week (1-7)
21.WEEKNUMWEEKNUM(<date>[, <return_type>])Returns the week number
22.YEARYEAR(<date>)Returns the year (1900-9999
23.YEARFRACYEARFRAC(<start_date>, <end_date>, <basis>)Calculates the fraction of the year between two dates

DAX Filter Functions

The following functions help you work with filters in DAX:

S.No.FunctionFormulaDescription
1.ALLALL( [<table> | <column>[, <column>[, <column>[,…]]]] )Returns all rows in a table or all values in a column, ignoring filters
2.ALLCROSSFILTEREDALLCROSSFILTERED(<table>)Clears all filters applied to a table
3.ALLEXCEPTALLEXCEPT(<table>,<column>[,<column>[,…]])Removes all context filters except those applied to specified columns
4.ALLNOBLANKROWALLNOBLANKROW( {<table> | <column>[, <column>[, <column>[,…]]]} )Returns all rows or distinct values, excluding blank rows, and disregards context filters
5.ALLSELECTEDALLSELECTED([<tableName> | <columnName>[, <columnName>[, <columnName>[,…]]]] )Removes context filters while retaining other filters
6.CALCULATECALCULATE(<expression>[, <filter1> [, <filter2> [, …]]]) –Evaluates an expression in a modified filter context.
7.CALCULATETABLECALCULATETABLE(<expression>[, <filter1> [, <filter2> [, …]]]) -.Evaluates a table expression in a modified filter context
8.EARLIEREARLIER(<column>, <number>)Returns the current value of a column in an outer evaluation pass.
9.EARLIESTEARLIEST(<column>)Returns the current value of a column in an outer evaluation pass.
10.FILTERFILTER(<table>,<filter>)Returns a subset of a table based on a filter.
11.KEEPFILTERSKEEPFILTERS(<expression>)Modifies how filters are applied during evaluation.
12.LOOKUPVALUELOOKUPVALUE( <result_columnName>, <search_columnName>, <search_value> [, <search2_columnName>, <search2_value>]… [, <alternateResult>] )Returns a value based on search conditions
13.REMOVEFILTERSREMOVEFILTERS([<table> | <column>[, <column>[, <column>[,…]]]])Clears filters from specified tables or columns.
14.SELECTEDVALUESELECTEDVALUE(<columnName>[, <alternateResult>])Returns a value when the context is filtered to one distinct value.

Financial Functions for Investments and Loans

The following functions help you calculate various aspects of investments and loans:

S.NoFunctionFormulaDescription
1. ACCRINTACCRINT(<issue>, <first_interest>, <settlement>, <rate>, <par>, <frequency>[, <basis>[, <calc_method>]])Returns the accrued interest for a security that pays periodic interest
2.ACCRINTMACCRINTM(<issue>, <maturity>, <rate>, <par>[, <basis>])Returns the accrued interest for a security that pays interest at maturity
3.AMORDEGRCAMORDEGRC(<cost>, <date_purchased>, <first_period>, <salvage>, <period>, <rate>[, <basis>])Returns the depreciation for each accounting period, considering the asset’s life
4.AMORLINCAMORLINC(<cost>, <date_purchased>, <first_period>, <salvage>, <period>, <rat6.e>[, <basis>])Returns the depreciation for each accounting period
5.COUPDAYBSCOUPDAYBS(<settlement>, <maturity>, <frequency>[, <basis>])Returns the number of days from the beginning of a coupon period until its settlement date
6.COUPDAYSCOUPDAYS(<settlement>, <maturity>, <frequency>[, <basis>])Returns the number of days in the coupon period that contains the settlement date
7.COUPDAYSNCCOUPDAYSNC(<settlement>, <maturity>, <frequency>[, <basis>])Returns the number of days from the settlement date to the next coupon date
8.COUPNCDCOUPNCD(<settlement>, <maturity>, <frequency>[, <basis>])Returns the next coupon date after the settlement date
9.COUPNUMCOUPNUM(<settlement>, <maturity>, <frequency>[, <basis>])Returns the number of coupons payable between the settlement date and maturity date
10.COUPPCDCOUPPCD(<settlement>, <maturity>, <frequency>[, <basis>])Returns the previous coupon date before the settlement date
11.CUMIPMTCUMIPMT(<rate>, <nper>, <pv>, <start_period>, <end_period>, <type>)Returns the cumulative interest paid on a loan
12.CUMPRINCCUMPRINC(<rate>, <nper>, <pv>, <start_period>, <end_period>, <type>)Returns the cumulative principal paid on a loan
13.DBDB(<cost>, <salvage>, <life>, <period>[, <month>])Returns the depreciation of an asset for a specified period
14.DDBDDB(<cost>, <salvage>, <life>, <period>[, <factor>])Returns the depreciation of an asset for a specified period
15.DISCDISC(<settlement>, <maturity>, <pr>, <redemption>[, <basis>])Returns the discount rate for a security
16.DOLLARDEDOLLARDE(<fractional_dollar>, <fraction>)Converts a dollar price to a decimal number
17.DOLLARFRDOLLARFR(<decimal_dollar>, <fraction>)Converts a dollar price to a fraction
18.DURATIONDURATION(<settlement>, <maturity>, <coupon>, <yld>, <frequency>[, <basis>])Returns the Macauley duration for a security
19.EFFECTEFFECT(<nominal_rate>, <npery>) –Returns the effective annual interest rate
20.FVFV(<rate>, <nper>, <pmt>[, <pv>[, <type>]])Calculates the future value of an investment
21.INTRATEINTRATE(<settlement>, <maturity>, <investment>, <redemption>[, <basis>])Returns the interest rate for a fully invested security
22.IPMTIPMT(<rate>, <per>, <nper>, <pv>[, <fv>[, <type>]])Returns the interest payment for a given period
23.ISPMTISPMT(<rate>, <per>, <nper>, <pv>)Calculates the interest paid for a specified period
24.MDURATIONMDURATION(<settlement>, <maturity>, <coupon>, <yld>, <frequency>[, <basis>])Returns the modified Macauley duration for a security
25.NOMINALNOMINAL(<effect_rate>, <npery>) Returns the nominal annual interest rate
26.NPERNPER(<rate>, <pmt>, <pv>[, <fv>[, <type>]])Returns the number of periods for an investment
27.ODDFPRICEODDFPRICE(<settlement>, <maturity>, <issue>, <first_coupon>, <rate>, <yld>, <redemption>, <frequency>[, <basis>])Returns the price per $100 face value of a security with an odd first period
28.ODDFYIELDODDFYIELD(<settlement>, <maturity>, <issue>, <first_coupon>, <rate>, <pr>, <redemption>, <frequency>[, <basis>])Returns the yield of a security with an odd first period
29.ODDLPRICEODDLPRICE(<settlement>, <maturity>, <last_interest>, <rate>, <yld>, <redemption>, <frequency>[, <basis>])Returns the price per $100 face value of a security with an odd last coupon period
30.ODDLYIELDODDLYIELD(<settlement>, <maturity>, <last_interest>, <rate>, <pr>, <redemption>, <frequency>[, <basis>])Returns the yield of a security with an odd last period
31.PDURATIONPDURATION(<rate>, <pv>, <fv>)Returns the number of periods required by an investment to reach a specified value
32.PMTPMT(<rate>, <nper>, <pv>[, <fv>[, <type>]])Calculates the payment for a loan
33.PPMTPPMT(<rate>, <per>, <nper>, <pv>[, <fv>[, <type>]]Returns the payment on the principal for a given period.
34.PRICEPRICE(<settlement>, <maturity>, <rate>, <yld>, <redemption>, <frequency>[, <basis>])Returns the price per $100 face value of a security.
35.PRICEDISCPRICEDISC(<settlement>, <maturity>, <discount>, <redemption>[, <basis>])Returns the price per $100 face value of a discounted security.
36.PRICEMATPRICEMAT(<settlement>, <maturity>, <issue>, <rate>, <yld>[, <basis>])Returns the price per $100 face value of a security that pays interest at maturity
37.PVPV(<rate>, <nper>, <pmt>[, <fv>[, <type>]])Calculates the present value of a loan or investment
38.RATERATE(<nper>, <pmt>, <pv>[, <fv>[, <type>[, <guess>]]])Returns the interest rate per period of an annuity
39.RECEIVEDRECEIVED(<settlement>, <maturity>, <investment>, <discount>[, <basis>])Returns the amount received at maturity for a fully invested security
40. RRI RRI(<nper>, <pv>, <fv>)Returns an equivalent interest rate for the growth of an investment
41.SLNSLN(<cost>, <salvage>, <life>)Returns the straight-line depreciation of an asset
42.SYDSYD(<cost>, <salvage>, <life>, <per>)Returns the sum-of-years’ digits depreciation of an asset
43.TBILLEQTBILLEQ(<settlement>, <maturity>, <discount>)Returns the bond-equivalent yield for a Treasury bill
44.TBILLPRICETBILLPRICE(<settlement>, <maturity>, <discount>)Returns the price per $100 face value for a Treasury bill
45.TBILLYIELDTBILLYIELD(<settlement>, <maturity>, <pr>)Returns the yield for a Treasury bill
46.VDBVDB(<cost>, <salvage>, <life>, <start_period>, <end_period>[, <factor>[, <no_switch>]])Returns the depreciation of an asset for any period
47.XIRRXIRR(<table>, <values>, <dates>, [, <guess>[, <alternateResult>]])Returns the internal rate of return for a schedule of cash flows
48.XNPVXNPV(<table>, <values>, <dates>, <rate>)Returns the present value for a schedule of cash flows
49.YIELDYIELD(<settlement>, <maturity>, <rate>, <pr>, <redemption>, <frequency>[, <basis>])Returns the yield on a security
50.YIELDDISCYIELDDISC(<settlement>, <maturity>, <pr>, <redemption>[, <basis>])Returns the annual yield for a discounted security
51.YIELDMATYIELDMAT(<settlement>, <maturity>, <issue>, <rate>, <pr>[, <basis>])Returns the annual yield of a security that pays interest at maturity

DAX Information Functions

The following functions provide information and insights about data, calculations, and the current user: 

S.NoFunctionFormulaDescription
1.CONTAINSCONTAINS(<table>, <columnName>, <value>[, <columnName>, <value>]…)Returns True if all referred values exist in the specified columns
2.CONTAINSROWCONTAINSROW(<Table>, <Value> [, <Value> [, …] ] )Returns True if a row of values exists in a table
3.CONTAINSSTRINGCONTAINSSTRING(<within_text>, <find_text>)Returns True if one string contains another string
4.CONTAINSSTRINGEXACTCONTAINSSTRINGEXACT(<within_text>, <find_text>)Returns True if one string contains another string, with exact matching
5.CUSTOMDATACUSTOMDATA()Returns custom data from the connection string
6.HASONEFILTERHASONEFILTER(<columnName>)Returns True if a column has only one directly filtered value
7.HASONEVALUEHASONEVALUE(<columnName>)Returns True if a column has only one distinct value in the current context
8.ISAFTERISAFTER(<scalar_expression>, <scalar_expression>[, sort_order [, <scalar_expression>, <scalar_expression>[, sort_order]]…)Returns True if a row meets all condition parameters
9.ISBLANKISBLANK(<value>)Returns True if a value is blank
10.ISCROSSFILTEREDISCROSSFILTERED(<TableNameOrColumnName>)Returns True if a column or related column is being filtered
11.ISEMPTYISEMPTY(<table_expression>)Returns True if a table is empty
12.ISERRORISERROR(<value>)Returns True if a value is an error
13.ISEVENISEVEN(number)Returns True if a number is even
14.ISFILTEREDISFILTERED(<TableNameOrColumnName>)Returns True if a column is being directly filtered
15.ISINSCOPEISINSCOPE(<columnName>)Returns True if a column is the current level in a hierarchy
16.ISLOGICALISLOGICAL(<value>)Returns True if a value is a logical value (True or False)
17.ISNONTEXTISNONTEXT(<value>)Returns True if a value is not text
18.ISNUMBERISNUMBER(<value>)Returns True if a value is a number
19. ISODDISODD(number)Returns True if a number is odd
20.ISSELECTEDMEASUREISSELECTEDMEASURE( M1, M2, … )Returns True if the selected measure is one of the specified measures
21.ISSUBTOTALISSUBTOTAL(<columnName>)Returns True if a row contains subtotal values for the specified column
22.ISTEXTISTEXT(<value>)Returns True if a value is text
23.NONVISUALNONVISUAL(<expression>)Marks a value filter as non-visual
24.SELECTEDMEASURESELECTEDMEASURE()Returns the selected measure
25.SELECTEDMEASUREFORMATSTRINGSELECTEDMEASUREFORMATSTRING()Returns the format string of the selected measure
26.SELECTEDMEASURENAMESELECTEDMEASURENAME()Returns the name of the selected measure
27.USERNAMEUSERNAME()Returns the domain name and username
28.USEROBJECTIDUSEROBJECTID()Returns the current user’s Object ID or SID
29.USERPRINCIPALNAMEUSERPRINCIPALNAME()Returns the user principal name

 DAX Logical Functions

The following functions help you perform logical operations and make decisions in your calculations:

S.NoFunctionFormulaDescription
1.ANDAND(<logical1>,<logical2>)Returns True if both conditions are met
2.BITANDBITAND(<number>, <number>) –Performs a bitwise AND operation on two numbers
3.BITLSHIFTBITLSHIFT(<Number>, <Shift_Amount>)Shifts the bits of a number to the left
4.BITORBITOR(<number>, <number>)Performs a bitwise OR operation on two numbers
5.BITRSHIFTBITRSHIFT(<Number>, <Shift_Amount>)Shifts the bits of a number to the right
6.BITXORBITXOR(<number>, <number>)Performs a bitwise XOR operation on two numbers
7.COALESCECOALESCE(<expression>, <expression>[, <expression>]…)Returns the first non-blank expression
8.FALSEFALSE()Returns the logical value False
9.IFIF(<logical_test>, <value_if_true>[, <value_if_false>])Tests a condition and returns one value if true, another value if false
10.IF.EAGERIF.EAGER(<logical_test>, <value_if_true>[, <value_if_false>])Similar to IF, but always evaluates both branches
11.IFERRORIFERROR(value, value_if_error)Returns a specified value if the expression returns an error
12.NOTNOT(<logical>)Reverses the logical value (True becomes False, False becomes True)
13.OROR(<logical1>,<logical2>)Returns True if either condition is met
14.SWITCHSWITCH(<expression>, <value>, <result>[, <value>, <result>]…[, <else>])Evaluates an expression and returns one of multiple possible results
15.TRUETRUE()Returns the logical value True

Math And Trig Functions

The following functions help you perform mathematical and trigonometric operations in your calculations:

S.No.FunctionFormulaDescription
1.ABSABS(<number>)Returns the absolute value of a number
2.ACOSACOS(number)Returns the angle whose cosine is the given number
3.ACOSHACOSH(number)Returns the inverse hyperbolic cosine of a number
4.ACOTACOT(number)Returns the angle whose cotangent is the given number
5.ACOTHACOTH(number)Returns the inverse hyperbolic cotangent of a number
6.ASINASIN(number)Returns the angle whose sine is the given number.
7.ASINHASINH(number)Returns the inverse hyperbolic sine of a number
8.ATANATAN(number)Returns the angle whose tangent is the given number
9.ATANHATANH(number)Returns the inverse hyperbolic tangent of a number
10.CEILINGCEILING(<number>, <significance>)Rounds a number up to the nearest integer or multiple
11.CONVERTCONVERT(<Expression>, <Datatype>)Converts an expression to a different data type
12.COSCOS(number).Returns the cosine of an angle
13.COSHCOSH(number)Returns the hyperbolic cosine of a number
14COTCOT (<number>)Returns the cotangent of an angle
15.COTHCOTH (<number>)Returns the hyperbolic cotangent of a number
16.CURRENCYCURRENCY(<value>)Evaluates an expression and returns the result as currency
17.DEGREESDEGREES(angle) Converts radians to degrees
18.DIVIDEDIVIDE(<numerator>, <denominator> [,<alternateresult>])Performs division and returns an alternate result or blank on division by zero.
19.EVENEVEN(number)Rounds a number up to the nearest even integer
20.EXPEXP(<number>)Returns e raised to a power.
21.FACTFACT(<number>)Returns the factorial of a number.
22.FLOORFLOOR(<number>, <significance>)Rounds a number down to the nearest integer or multiple
23.GCDGCD(number1, [number2], …)Returns the greatest common divisor of two or more integers
24.INTINT(<number>)Rounds a number down to the nearest integer
25.ISO.CEILINGISO.CEILING(<number>[, <significance>])Rounds a number up to the nearest integer or multiple
26.LCMLCM(number1, [number2], …)Returns the least common multiple of integers
27.LNLN(<number>)Returns the natural logarithm of a number.
28.LOGLOG(<number>,<base>)Returns the logarithm of a number to a specified base.
29.LOG10LOG10(<number>)Returns the base-10 logarithm of a number.
30.MODMOD(<number>, <divisor>)Returns the remainder of division.
31.MROUNDMROUND(<number>, <multiple>)Rounds a number to a multiple
32.ODDODD(number)Rounds a number up to the nearest odd integer
33.PIPI()Returns the value of Pi
34.POWERPOWER(<number>, <power>)Returns a number raised to a power
35.QUOTIENTQUOTIENT(<numerator>, <denominator>)Performs division and returns the integer part
36.RADIANSRADIANS(angle)Converts degrees to radians
37.RANDRAND()Returns a random number between 0 and 1
38.RANDBETWEENRANDBETWEEN(<bottom>,<top>)Returns a random number between two numbers
39.ROUNDROUND(<number>, <num_digits>)Rounds a number to a specified number of digits
40.ROUNDDOWNROUNDDOWN(<number>, <num_digits>)Rounds a number down
41.ROUNDUPROUNDUP(<number>, <num_digits>)Rounds a number up, away from zero
42.SIGNSIGN(<number>)Determines the sign of a number, calculation result, or column value
43.SINSIN(number)Returns the sine of a given angle
44.SINHSINH(number)Returns the hyperbolic sine of a number
45.SQRTSQRT(<number>)Returns the square root of a number
46.SQRPTPISQRTPI(number)Returns the square root of the product of a number and pi
47.TANTAN(number)Returns the tangent of a given angle
48.TANHTANH(number)Returns the hyperbolic tangent of a number
49.TRUNCTRUNC(<number>,<num_digits>)Truncates a number to an integer by removing the decimal or fractional part

You may like to read other blocks i.e.

Leave a Reply

Your email address will not be published. Required fields are marked *