The SELECTEDMEASURE function in Power BI's DAX (Data Analysis Expressions) language is a powerful tool used primarily within calculation groups to dynamically reference the measure currently being evaluated in a report. It’s part of the calculation group feature introduced to streamline complex reporting scenarios and improve maintainability by reducing the need to duplicate measure logic. What is SELECTEDMEASURE? SELECTEDMEASURE is a DAX function that returns a reference to the measure that is currently active or "selected" in the context of a calculation group. It doesn’t take any arguments and is typically used in the expression of a calculation item within a calculation group. This allows you to write generic logic that can dynamically apply to whichever measure is being evaluated in a visual, without hardcoding specific measure names. Syntax SELECTEDMEASURE() Returns: A reference to the measure currently being evaluated in the report context. Use Case SELECTEDME...
Power BI DAX Function: ENDOFWEEK Description The ENDOFWEEK function is a Time Intelligence function in DAX (Data Analysis Expressions) used in Power BI. It returns the date that represents the end of the week containing a specified date (typically Saturday, as weeks are considered to start on Sunday by default in DAX time intelligence). Syntax ENDOFWEEK( [, ]) : A column reference (usually from a Date table) or a date expression. Required. : Optional. Specifies the week-ending convention. Default is Saturday if omitted. Examples 1. Basic usage (default: week ends on Saturday): End of Week = ENDOFWEEK('Date'[Date]) For a date like January 8, 2026 (Thursday), this would return January 10, 2026 (Saturday). 2. In a measure for cumulative sales up to end of week: Total Sales to End of Week = CALCULATE( SUM(Sales[Amount]), DATESBETWEEN('Date'[Date], ST...
Power BI DAX Function: INFO.VIEW.COLUMNS() INFO.VIEW.COLUMNS() is a DAX table function that returns a table containing metadata about all columns in the current Power BI semantic model. Description This function provides detailed information on each column, including: Table : The name of the table the column belongs to. Name : The column name. Description : Any description added to the column. Expression : The DAX formula if it's a calculated column (blank for regular columns). DataCategory : Category like "Time", "Image", etc. DataType : The data type of the column. IsHidden : Whether the column is hidden. And other metadata fields. It uses friendly names (e.g., table and column names instead of IDs) and is designed for ease of use compared to the base INFO.COLUMNS() function. Syntax INFO.VIEW.COLUMNS() No parameters. Returns a table. Restrictions Requires write permissions on the semantic model. ...
Comments
Post a Comment