Forum Discussion
Help on implicit measure vs explicit measure
- Anonymous2 years ago
Hi jip34 ,
Implicit measures are created automatically when you drag a field into the Values area of a visualization. Power BI creates a default aggregation like sum, count, average, etc., based on the data type of the field. These are quick and easy to use but offer limited flexibility.
Explicit measures, on the other hand, are created by writing a DAX formula. They provide greater flexibility and control over the calculation. Here are some advantages of explicit measures:
1. Complex Logic: Explicit measures allow you to incorporate complex business logic that cannot be achieved with simple aggregations.
2. Reusability: Once created, explicit measures can be reused across different reports and visualizations without the need to recreate the logic.
3. Performance: Explicit measures can be optimized for performance, especially in large datasets.
4. Consistency: Ensures consistent calculations across your reports, as the DAX formula is centrally managed.
Here's an example where an explicit measure is necessary:
Scenario: You want to calculate the year-over-year growth percentage for sales. This requires a comparison between sales in the current year and the previous year.
Explicit Measure DAX Formula:
Sales YoY Growth % = VAR CurrentYearSales = CALCULATE(SUM(Sales[Amount]), Sales[Year] = YEAR(TODAY())) VAR PreviousYearSales = CALCULATE(SUM(Sales[Amount]), Sales[Year] = YEAR(TODAY()) - 1) RETURN IF( NOT ISBLANK(PreviousYearSales), (CurrentYearSales - PreviousYearSales) / PreviousYearSales, BLANK() )This calculation cannot be achieved with an implicit measure because it involves conditional logic and time intelligence functions that are not available in the default aggregations.
To summarize, while implicit measures are quick and easy for simple aggregations, explicit measures are essential when you need to perform more complex calculations or when you want to ensure consistency and optimize performance across your reports.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Here is an article from RADACAD about situations where explicit is bettter than implicit
- jip342 years agoRegular Visitor
Yes but i have already it
But when he says "Writing an explicit measure will give you more flexibility of course. You can use DAX functions such as Calculate, filter functions, or whatever you want. Using the implicit measures, you are limited to the aggregation listed in the Power BI Desktop." it doesnt help much more....all the more in his example the result between explicit and implicit measure is the same
It would have been better to show what the explicit measure can do and what the implicit measure cannot do
- Anonymous2 years agoNot applicable
Hi jip34 ,
Implicit measures are created automatically when you drag a field into the Values area of a visualization. Power BI creates a default aggregation like sum, count, average, etc., based on the data type of the field. These are quick and easy to use but offer limited flexibility.
Explicit measures, on the other hand, are created by writing a DAX formula. They provide greater flexibility and control over the calculation. Here are some advantages of explicit measures:
1. Complex Logic: Explicit measures allow you to incorporate complex business logic that cannot be achieved with simple aggregations.
2. Reusability: Once created, explicit measures can be reused across different reports and visualizations without the need to recreate the logic.
3. Performance: Explicit measures can be optimized for performance, especially in large datasets.
4. Consistency: Ensures consistent calculations across your reports, as the DAX formula is centrally managed.
Here's an example where an explicit measure is necessary:
Scenario: You want to calculate the year-over-year growth percentage for sales. This requires a comparison between sales in the current year and the previous year.
Explicit Measure DAX Formula:
Sales YoY Growth % = VAR CurrentYearSales = CALCULATE(SUM(Sales[Amount]), Sales[Year] = YEAR(TODAY())) VAR PreviousYearSales = CALCULATE(SUM(Sales[Amount]), Sales[Year] = YEAR(TODAY()) - 1) RETURN IF( NOT ISBLANK(PreviousYearSales), (CurrentYearSales - PreviousYearSales) / PreviousYearSales, BLANK() )This calculation cannot be achieved with an implicit measure because it involves conditional logic and time intelligence functions that are not available in the default aggregations.
To summarize, while implicit measures are quick and easy for simple aggregations, explicit measures are essential when you need to perform more complex calculations or when you want to ensure consistency and optimize performance across your reports.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- jip342 years agoRegular Visitor
Many thanks for your very good answer!