Search code examples
powerbicalculated-columnsmeasure

Power BI: Calculated column or Measure


I have following data:

Table: PriceTable

Price  Applicable1  Applicable2  Percentage
--------------------------------------------
100    Yes          Yes          0.10
200    Yes          No           0.50
300    No           Yes          0.30
500    Yes          Yes          0.40

I want to calculate the Percentage of price in last column and show in the table/matrix in the power bi report.

Scenario: If both column Applicable1 and Applicable2 are equal to Yes then calculate the percentage of price in the final column.

My try: I have taken New Column and added following DAX:

Commission = IF( PriceTable[Applicable1] = "Yes" &&
                 PriceTable[Applicable2] = "Yes", 
                 PriceTable[Price] * PriceTable[Percentage], 0)

Question:

  1. Which one should I use New Column OR Measure?
  2. If Measure, then how to calculate the same?

Solution

  • Rob Collie has an excellent blog post on "When to Use Measures vs. Calc Columns"

    And Reza Rad has another good post:

    Measure vs Calculated Column: The Mysterious Question? Not!

    My favourite take-away from this is:

    If you want to put it on rows, columns, slicers, or report filters, it MUST be a column