Day 4 : MINA
This function returns a scaler value that gives the minimum value of a column.
It will convert strings to a number if possible otherwise set trext to 0.
Treats boolean as True =1 and false = 0.
The standard Min function only returns the minimum of numeric values only
Example:
Let's assume we have a table named "Sales" with columns "Product" and "Sales Amount". To find the minimum sales amount, we can use the MINA function as follows:
Minimum Sales Amount = MINA('Sales'[Sales Amount])
This formula will create a measure called "Minimum Sales Amount" that calculates the smallest value in the "Sales Amount" column of the "Sales" table.
Key Points:
• Handles Null Values: The MINA function automatically ignores null values, making it robust for real-world datasets.
• Works with Columns or Expressions: You can use either a column name or a scalar expression as the argument.
• Returns a Scalar Value: The function always returns a single numerical value representing the minimum.
Additional Considerations:
• Filtering: You can combine MINA with filters to find the minimum value within a specific context. For example, to find the minimum sales amount for a particular product category, you could use a filter inside the MINA function.
• Performance: For large datasets, consider using techniques like calculated columns or measures to optimize performance.
Comments
Post a Comment