Posts

Showing posts from December, 2024

Daily DAX : Day 80 AVERAGEA

 The AVERAGEA function in Power BI's Data Analysis Expressions (DAX) language is used to calculate the average of a set of numbers, including any text or blank cells which are treated as 0 in the calculation. Here's a breakdown of how it works and its main use case: Function Syntax dax AVERAGEA(<column>) How AVERAGEA Works:     Evaluation: AVERAGEA evaluates each value in the column or expression provided. If the value is numeric, it's included in the average calculation.     Handling Non-Numeric Values: Unlike AVERAGE, AVERAGEA does not ignore text or blank cells. Instead, it treats text as 0, and blanks are also considered as 0. This makes AVERAGEA more inclusive in terms of what data it processes. Main Use Cases:     Inclusion of Non-Numeric Data: When you have a dataset where some entries might be text or blank, AVERAGEA can be useful. For example, if you're averaging survey responses where some responses might be text like "N/A", AVERAGEA wi...

Daily DAX : Day 79 ISBLANK

 Explanation of the ISBLANK Function in Power BI DAX ISBLANK is a function in Data Analysis Expressions (DAX) used in Power BI, Excel Power Pivot, and other tools that support DAX. The function checks if an expression or value is blank (null or empty). Its syntax is: dax ISBLANK(<value>)     value: This is the expression or column reference you want to check for blankness. The function returns:     TRUE if the value is blank.     FALSE otherwise. Key Points:     Blank in DAX does not necessarily mean an empty cell in the traditional sense. It includes:         Null values         Empty strings in text columns (but not spaces)         Cells or calculated expressions that result in no value     Usage Considerations:         ISBLANK is case-sensitive for the function name.         It does not equate empty strings with blanks unless...

Daily DAX: Day 78 INFO.FORMATSTRINGDEFINITIONS

 The function INFO.FORMATSTRINGDEFINITIONS in Power BI corresponds to the TMSCHEMA_FORMAT_STRING_DEFINITIONS Dynamic Management View (DMV) in the context of Power BI's model metadata. Here's a detailed explanation based on the search results: Overview of INFO.FORMATSTRINGDEFINITIONS     Function: INFO.FORMATSTRINGDEFINITIONS([<RestrictionName>, <RestrictionValue>, ...])     Returns: An entire table or a table with one or more columns, specifically corresponding to the TMSCHEMA_FORMAT_STRING_DEFINITIONS DMV. Main Use Case:     Metadata Querying: The function is used to retrieve detailed information about format string definitions within the Power BI model. This includes how data formats like currency, dates, or custom formats are defined and used within measures, calculated columns, or other model objects.     Model Documentation: This function can be particularly useful for documenting the Power BI model. It helps in understanding...

Daily DAX : Day 77 SECOND

 The SECOND function in Power BI's Data Analysis Expressions (DAX) is used to extract the second value from a given time or datetime value. Here's a detailed explanation: Function Syntax: dax SECOND(<datetime>)     <datetime>: This is the argument that specifies the date or time from which you want to extract the second. This can be a column of datetime values, a specific datetime value, or a time value. Return Value:     The function returns an integer from 0 to 59 representing the second of the minute. Main Use Cases:     Time Analysis:         Granular Time Tracking: If you're analyzing data where seconds matter, like in manufacturing processes, system logs, or sports analytics, you can use SECOND to break down timestamps into their smallest unit for detailed analysis.         Event Timing: For tracking the exact timing of events within a minute, such as the duration of calls in a call center or re...

Daily DAX : Day 76 ROLLUPDISSUBTOTAL

 The ROLLUPADDISSUBTOTAL function in Power BI's Data Analysis Expressions (DAX) language is used to add or remove subtotal rows from a result set that has been generated by a ROLLUP function. Here's a breakdown of its functionality and main use case: Function Syntax: dax ROLLUPADDISSUBTOTAL(<expression>, <isSubtotal>) Parameters:     <expression>: The column or expression for which you want to determine whether the current row is a subtotal.     <isSubtotal>: A boolean expression that evaluates to TRUE if the current row is a subtotal, otherwise FALSE. How it Works:     When used within a ROLLUP context, ROLLUPADDISSUBTOTAL can modify how subtotals are displayed or calculated:         If isSubtotal is TRUE, it means the function will consider the current row as a subtotal.         If isSubtotal is FALSE, it excludes the current row from being treated as a subtotal. Main Use Case:   ...

Daily DAX : Day 75 NATURAL.INNERJOIN

 he NATURALINNERJOIN function in Power BI's DAX (Data Analysis Expressions) language is used to perform an inner join between two tables based on columns with the same name in both tables. Here's a detailed explanation: Explanation:     Inner Join Concept: An inner join returns only the rows that have matching values in both tables. If a row in one table does not have a corresponding match in the other table, it will not appear in the result set.     Natural Join: Unlike a traditional join where you specify which columns to join on, a natural join automatically matches columns by name. This means that NATURALINNERJOIN looks for columns in both tables that share the same name and uses these for the join condition.     Syntax: The syntax for NATURALINNERJOIN is straightforward:     NATURALINNERJOIN(Table1, Table2)         Table1 and Table2 are the names of the tables you want to join. Main Use Case:     Data Integr...

Daily DAX : Day 74 FIRSTDATE

 The FIRSTDATE function in Power BI's Data Analysis Expressions (DAX) is used to return the first date in the specified column of dates. Here's a detailed explanation: Syntax: dax FIRSTDATE(<dates>)     <dates>: This is a column that contains dates. Description:     FIRSTDATE scans through the specified date column and returns the earliest date it finds.     If there are no dates in the column or if the column is empty, it returns a blank. Typical Use Cases:     Date Dimension Analysis:         When working with time intelligence in Power BI, you often need to know the first date of a period for calculations like year-to-date, month-to-date, etc. For example, to calculate sales from the start of the year:         dax     SalesYTD = CALCULATE(SUM(Sales[Amount]), DATESYTD(Dates[Date]))     Here, FIRSTDATE could be used within DATESYTD to ensure you're starting from the firs...

Daily DAX : Day 73 CONFIDENCE.T

 A statistical DAX function that returns the confidence interval for a population mean, using a Student’s t distribution. Syntax CONFIDENCE.T(<alpha>,<standard_deviation>,<sample_size>) https://dax.guide/confidence-t/

Daily DAX : Day 72 NOMINAL

 The NOMINAL function in Power BI's Data Analysis Expressions (DAX) language is used to calculate the nominal annual interest rate, given the effective annual interest rate and the number of compounding periods per year. Syntax: dax NOMINAL(effect_rate, npery)     effect_rate: This is the effective interest rate. It's the actual interest earned or paid in a year, after accounting for compounding.     npery: This stands for "number of periods per year", which indicates how many times the interest is compounded within a year. Explanation:     Nominal Interest Rate: This is also known as the stated or annual percentage rate (APR). It does not take into account the effects of compounding within the year.      Effective Interest Rate: This rate considers the effect of compounding. If interest is compounded more than once a year, the effective rate will be higher than the nominal rate. Calculation: The formula for converting from an effective ...

Daily DAX : Day 71 INFO.RELATIONSHIPINDEXSTORAGES

 The INFO.RELATIONSHIPINDEXSTORAGES function in Power BI's DAX (Data Analysis Expressions) is part of a set of new INFO functions introduced in the December 2023 Power BI Desktop release. Here's an explanation and the main use case for this function: Explanation:     Function Purpose: INFO.RELATIONSHIPINDEXSTORAGES provides information about the storage of relationship indexes within the semantic model of Power BI. This function is particularly useful for understanding how relationships are indexed, which can affect query performance and model optimization.     Function Syntax: The exact syntax for INFO.RELATIONSHIPINDEXSTORAGES isn't detailed in the public documentation, but like other INFO functions, it would typically be called without parameters:     DAX     INFO.RELATIONSHIPINDEXSTORAGES()     Return Value: This function returns a table with columns that describe the storage details of relationship indexes. This might include i...

Daily DAX : Day 70 INFO.TABLES

INFO.TABLES: This function returns a table that provides metadata about all the tables within your Power BI model. It mirrors the TMSCHEMA_TABLES DMV, which provides information like table names, descriptions, whether the table is hidden, and more. Use Case: Scenario: Model Metadata Analysis You're a data modeler or BI developer tasked with auditing your Power BI model structure before deployment or during maintenance. Here's how INFO.TABLES could be used:     Audit Table Structure:         You can use INFO.TABLES to get a comprehensive list of all tables in your model, including their properties like visibility, description, and type.     Example DAX Query:     dax EVALUATE INFO.TABLES() This will return a table with columns like:     TableID: A unique identifier for the table.     TableName: The name of the table as it appears in Power BI.     Description: Any description associated with the table.   ...

Daily DAX : Day 69 ODDFPRICE

The ODDFPRICE function in Power BI's Data Analysis Expressions (DAX) is used to calculate the price per $100 face value of a security that has an odd (irregular) first period. Here's a practical use case for this function: Use Case: Pricing a Newly Issued Bond with an Irregular First Coupon Scenario: A financial institution issues a bond with the following characteristics:     Face Value: $1,000     Annual Coupon Rate: 5%     Settlement Date: March 15, 2023     First Coupon Date: September 15, 2023 (6 months from issuance)     Maturity Date: March 15, 2033     Issue Date: January 1, 2023 (This creates an odd first period since the first coupon payment is not aligned with typical coupon intervals) Objective: Calculate the price of the bond at the settlement date, considering the odd first period where the bond has already accrued interest from January 1 to March 15. Using DAX in Power BI: You would use the ODDFPRICE function wit...

Daily DAX : Day 68 INFO.ATTRIBUTEHIERARCHIES

 This is a meta data DAX function that returns a table with attribute information about Hierarchies in your dimension     Syntax: INFO.ATTRIBUTEHIERARCHIES(<Dimension>)         <Dimension> is a reference to a dimension table in your data model.     Return Value: This function returns a table with columns for each attribute hierarchy in the specified dimension. The table includes:         AttributeHierarchyID: A unique identifier for the attribute hierarchy.         AttributeHierarchyName: The name of the attribute hierarchy.         AttributeHierarchyDefaultMember: The default member for the attribute hierarchy, if defined.         AttributeHierarchyOrdered: A boolean indicating whether the hierarchy is ordered.         AttributeHierarchyIsVisible: A boolean indicating if the hierarchy is visible in the user interface. https://dax.g...

Daily DAX : Day 67 AMORDEGRC

 A financial DAX for French Accounting that returns the depreciation for each accounting period Syntax AMORDEGRC ( <Cost>, <Date_purchased>, <First_period>, <Salvage>, <Period>, <Rate> [, <Basis>] ) https://dax.guide/amordegrc/

Daily DAX : Day 66 DATE

 A DAX function that returns a date time format for date based on year, month, day provided Syntax DATE(<Year>,<Month>,<Day>) https://dax.guide/date/

Daily DAX : Day 65 INFO.TABLEPERMISSIONS

 A metadata DAX function that returns a list of all table permissions in the current model with columns matching the schema rowset for table permissions objects Syntax INFO.TABLEPERMISSIONS(<RestrictionName>,<RestrictionValue>) Returns a table with the following fields Field Type ID Integer RoleID Integer TableID Integer FilterExpression String ModifiedTime DateTime State Integer ErrorMessage String MetadataPermission Integer https://dax.guide/info-tablepermissions/

Daily DAX : Day 64 MAX

 One of the core aggregation functions that retuns the highest value of a column or a list of scalar values. Syntax MAX(<ColumnName>, <ScalarValue) https://dax.guide/max/

Daily DAX : Day 63 IPMT

 A financial DAX function that returns the interest payment for a given period for an investment based on periodic, constant payments and a constant interest rate. Syntax IPMT(<InterestRate>, <Period>, <NrPaymentPeriods>, <PresentValue>, <FutureVallue>, <Type>) https://dax.guide/ipmt/

Daily DAX : Day 62 SELECTEDMEASURENAME

 DAX function that returns name of the measure that is currently being evaluated. Does not take any parameters. Syntax SELECTEDMEASURENAME() https://dax.guide/selectedmeasurename/

Daily DAX : Day 61 ISFILTERED

A logical DAX function that returns true when there are direct filters on the specified column. Syntax ISFILTERED(<TableorColumnName>) https://dax.guide/isfiltered/

Daily DAX : Day 60 EXERNALMEASURE

 A function that invokes a DAX measure from an external Data Model Syntax EXTERNALMEASURE(<MeasureName>,<DataType>,<Connection>) https://dax.guide/externalmeasure/

Daily DAX : Day 59 EXCEPT

 A table DAX function that returns the rows of left-side table which do not appear in right-side table. Syntax EXCEPT(<Left_Table>.<Right_Table>) https://dax.guide/except/

Daily DAX : Day 58 COTH

A mathematical DAX function that returns the inverse hyperbolic cotangent of a number Syntax COTH(<Number>) https://dax.guide/acoth/

Daily DAX : Day 57 SELECTEDMEASUREFORMATSTRING

 A DAX function that returns format string for the measure that is currently being evaluated. Does not take in a parameter Syntax  SELECTEDMEASUREFORMATSTRING()  https://dax.guide/selectedmeasureformatstring/

Daily DAX : Day 56 FIRST

 DAX finction that retrieves a value in the Visual Calculation data grid from the first row of an axis. Syntax FIRST(<Expression>, <Axis>, <Blanks>, <Reset>) https://dax.guide/first/

Daily DAX : Day 55 PV

A financial DAX function that calculates the present value of a loan or an investment, based on a constant interest rate. You can use PV with either periodic, constant payments (such as a mortgage or other loan), or a future value that’s your investment goal. Syntax PV(<Rate>, <Nr_of_Periods>,<Payments_per_period>,<Future_Value>,<Type>) https://dax.guide/pv/

Daily DAX : Day 54 ISPMT

A financial DAX function that calculates the interest paid (or received) for the specified period of a loan (or investment) with even principal payments. Syntax ISPMT(<Rate>, <Period>, <Number_of_Payment_Periods>, <Present_Value>) https://dax.guide/ispmt/

Daily DAX : Day 53 PERMUT

 A statistical DAX function that returns the number of possible permutations of  a number being selected. Eg. if number of items is 3 and you want to choose 2 numbers then permut would  return 6 Syntax PERMUT(<Number>,<Number_chosen>) https://dax.guide/permut/

Daily DAX : Day 52 ROW

 A Dax function that returns a single row table wth the columns specified Syntax ROW(<Name_of_Column>, <Expression_for_Column>) https://dax.guide/row/

Daily DAX : Day 51 HASH

 This function returns the hashed number of  a variable number of expressions Syntax HASH(<expresssion>, <expression>) https://dax.guide/hash/

Daily DAX : Day 50 STDEVX.P

 This is a statistical DAX function that estimates the standard deviation based on the entire population by evaluating an expression for each row of a table. Syntax STDEVX.P(<Table>, <Expression>) https://dax.guide/stdevx-p/