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: INFO.CSDLMETADATA INFO.CSDLMETADATA` is a specialized DAX function introduced as part of a broader set of "INFO" functions (like `INFO.TABLES` or `INFO.MEASURES`) used for **model introspection**. It allows you to programmatically access the underlying structure of your Power BI semantic model. What does it do? The function returns a table with a single column containing the Conceptual Schema Definition Language (CSDL) metadata of your model in XML format . In plain English, it exports a highly technical "blueprint" of your entire data model—including tables, columns, relationships, and measures—as a structured XML string. It is essentially the DAX equivalent of the `DISCOVER_CSDL_METADATA` Dynamic Management View (DMV) used in Analysis Services. --- Syntax and Output The syntax is straightforward as it requires no arguments: ```dax EVALUATE INFO.CSDLMETADATA() ``` Return Value : A table with one column and one row. Content : A long string ...
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