Need Help with IF( formula in PowerPivot

I have the following formula that works in Excel, that I am trying to move to a PowerPivot calculated column.  I am getting #ERROR now.

Here is the Excel formula:

=IF([@Type]="SS",IF([@[Avail + On PO]]>0,0,ROUNDUP(([@[Avail + On PO]]*-1)/[@[MOQ ]],0)*[@[MOQ ]]),0)

My first attempt was to re-write the formula in powerpivot using the correct column references as follows:

=If([Type]="SS",IF([Avail Plus On PO]>0,0,ROUNDUP(([Avail Plus On PO]*-1)/[MOQ],0)*[MOQ]),0)

Type is text, all others are set as whole number

March 23rd, 2015 2:55pm

Does this behave as expected?

=
IF
(
  [Type]="SS",
  IF(
    [Avail Plus On PO] > 0, 
    0,
    ROUNDUP(DIVIDE([Avail Plus On PO] * -1, [MOQ]), 0) * [MOQ]
  ),
  0
)
Free Windows Admin Tool Kit Click here and download it now
March 23rd, 2015 3:07pm

Thank you, that did the trick.

Any recommendations on sites, books, resources where I can learn more about DAX? 

March 23rd, 2015 6:44pm

A good book is Microsoft Excel 2013: Building Data Models with PowerPivot by Marco Russo and Alberto Ferrari. There are also some good online resources such as QuickStart: Learn DAX Basics in 30 Minutes and Microsoft Virtual Academy e.g. Data Visualizations with Power BI in Excel 2013
Free Windows Admin Tool Kit Click here and download it now
March 27th, 2015 1:05pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics