Forum Discussion
Anonymous
9 years agoNot applicable
DAX - IF Format
Hi All, I am trying to do a SUM on column [Total Amount] when column [Promotion_id] is blank AND column [order_order_scr] = 1 My DAX for new column is; NoOfferTotal = IF(AND(FORMAT([order...
- 9 years ago
v-jiascu-msft is right and it's a better solution in case that promition_id is actually "" in some cases.
revised codes:
measure = CALCULATE( SUM('POS Data 1'[Total Amount]), 'POS Data 1'[promotion_id] = BLANK(), 'POS Data 1'[order_order_src] = 1 ) column = IF( AND( 'POS Data 1'[promotion_id] = BLANK(), 'POS Data 1'[order_order_src] = 1 ), 'POS Data 1'[Total Amount] )
v-jiascu-msft
9 years agoMicrosoft Employee
Anonymous
Hi,
It seems that the answer is there. So I just give a suggestion that you can replace "" with BLANK(). "Format" isn't needed.
Best Regards!
Dale
- sdjensen9 years agoSolution Sage
v-jiascu-msft is right and it's a better solution in case that promition_id is actually "" in some cases.
revised codes:
measure = CALCULATE( SUM('POS Data 1'[Total Amount]), 'POS Data 1'[promotion_id] = BLANK(), 'POS Data 1'[order_order_src] = 1 ) column = IF( AND( 'POS Data 1'[promotion_id] = BLANK(), 'POS Data 1'[order_order_src] = 1 ), 'POS Data 1'[Total Amount] )