Dax Function: INFO.VIEW.MEASURES

Category: INFO Functions

The INFO.VIEW.MEASURES function in Power BI is a DAX (Data Analysis Expressions) function that retrieves metadata about the measures defined in a data model. It provides details such as measure names, expressions, and other attributes, allowing users to programmatically analyze and document measures in their models.

Purpose

The INFO.VIEW.MEASURES function is designed to extract metadata about measures within a Power BI model. This is especially useful for managing large and complex models where understanding measure definitions and properties is critical.

Type of Calculations it Performs

  • Non-calculative metadata extraction.

  • Retrieves detailed information about measures, including:

    • Measure names.

    • Associated expressions.

    • Measure-specific properties such as data types and formatting.

Practical Use Cases

  • Documentation: Automate the generation of documentation for measures in a Power BI model.

  • Debugging: Identify and analyze measure definitions for debugging or optimization purposes.

  • Dynamic Reporting: Build reports that adapt to changes in measure definitions.

  • Auditing: Validate and audit measures in large datasets.


INFO.VIEW.MEASURES(<model_name>)</model_name>

ParameterTypeDescription
model_nameTableThe name of the model or schema from which measures are to be analyzed.

How Does INFO.VIEW.MEASURES Dax Works

  1. Input Model: Takes the name of the model as input.

  2. Metadata Retrieval: Queries the model to extract all defined measures and their properties.

  3. Output Table: Returns a table with one row per measure, listing all metadata properties.

Example Formula

For a model named SalesModel:

INFO.VIEW.MEASURES(SalesModel)

This will return a table containing metadata for all measures in the SalesModel.

What Does It Return?

The function returns a table with the following information for each measure:

  • Measure Name: The name of the measure.

  • Expression: The DAX formula defining the measure.

  • Data Type: The data type of the measure’s result (e.g., Decimal, Integer).

  • Formatting: Information about any formatting applied to the measure.

When Should We Use It?

  • To document all measures in a model for team collaboration or compliance.

  • During the debugging process to review measure definitions and properties.

  • When creating dynamic dashboards that reflect changes in measure definitions.

  • To audit models for consistency and adherence to naming conventions.

Examples

Basic Usage :

Retrieve metadata for measures in a model:


INFO.VIEW.MEASURES(InventoryModel)

This might return:

Measure NameExpressionData TypeFormatting
Total SalesSUM(Sales[Amount])DecimalCurrency
Average MarginAVERAGE(Sales[Margin])DecimalPercentage

Column Usage

Use the returned metadata to create a dynamic report listing all measures:


Report.Measures = INFO.VIEW.MEASURES(FinanceModel)

Advanced Usage

Combine with filtering to isolate measures meeting specific criteria:


FILTER(INFO.VIEW.MEASURES(ProductionModel), [Data Type] = "Decimal")

This retrieves only the decimal measures from the ProductionModel.

Tips and Tricks

  • Filter Metadata: Use filtering to narrow down results when working with models containing numerous measures.

  • Schema Validation: Combine with other metadata functions for comprehensive model validation.

Potential Pitfalls

  • The function may fail if the specified model does not exist or is misspelled.

  • Performance may degrade when querying very large models.

Performance Impact of INFO.VIEW.MEASURE DAX Function:

  • Efficient for small to medium-sized models.

  • Use filters to optimize performance when working with large datasets.

Related Functions You Might Need

Want to Learn More?
For more information, check out the official Microsoft documentation for INFO.VIEW.MEASURE You can also experiment with this function in your Power BI reports to explore its capabilities.

Unlock the full capabilities of Power BI and elevate your data insights with our specialized consulting services. Whether you need guidance on advanced DAX functions like those highlighted here, support in designing interactive dashboards, or expertise in optimizing data models for enhanced performance, our experienced Power BI consultants are equipped to deliver customized solutions for your business. Explore our Power BI Consulting Services page to discover how we can help your organization make smarter, data-driven decisions.

1. What does the INFO.VIEW.MEASURES function do?

It retrieves metadata about measures in a specified model, including names, expressions, and properties.

2. Can INFO.VIEW.MEASURES be used with custom models?

Yes, as long as the model exists in the Power BI environment.

3. What properties are returned by INFO.VIEW.MEASURES?

The function returns details such as measure names, expressions, data types, and formatting.

4. Is INFO.VIEW.MEASURES dynamic?

Yes, it dynamically retrieves the latest metadata from the model.

5. How to optimize performance with INFO.VIEW.MEASURES?

Use filters to limit the output to relevant measures, especially in large models.