Search code examples
powerbidaxpowerpivot

Operate Function just for selected Rows


I am struggling a bit with a pretty simple measure. I have an order table that contains 3 columns:

  • Order-Nr
  • State
  • Quantity

Now I would like to DIVIDE the quantity by 2, but just for completed orders. That means all orders with state >= 50. In the end, I would like to use the measure to aggregate this information based on an additional table that contains the country information.

How would you build that measure? Would you use an iteration function? A SWITCH or IF?

I am grateful for every help!


Solution

  • Do you need a Calculated Column or Measure??

    Your measure/Calculated column may look like that:

    DividedBy = calculate( DIVIDE ( table[Quantity], 2 ),
    KEEPFILTERS( table[State] >= 50))