Forum Discussion
Anonymous
4 years agoNot applicable
Subtotal miscaculation using an IF function
Hello, I have been strugglin to solve the situation with the formula below: DM EX 50% = IF([GAP HORAS]<0,0, ((SUM('PLANNED HOURS'[MAINTENANCE BUDGET]) - SUM('WORK_ORDER_CODING_UIV'[MAINTENA...
Anonymous
4 years agoNot applicable
amitchandak
4 years agoSuper User
Anonymous , You need force row context using all matrix rows . This is an example using correct fact and dimension in summarize you need to do that
sumx(ADDCOLUMNS( summarize( 'WORK_ORDER_CODING_UIV', 'WORK_ORDER_CODING_UIV'[Contract], 'WORK_ORDER_CODING_UIV'[Year]), "_1",
calculate(IF([GAP HORAS]<0,0,
((SUM('PLANNED HOURS'[MAINTENANCE BUDGET]) - SUM('WORK_ORDER_CODING_UIV'[MAINTENANCE COST]) - SUM('PLANNED HOURS'[MAINTENANCE BUDGET DM]))*0.5)))), [_1])
why my grand total is wrong -https://www.youtube.com/watch?v=ufHOOLdi_jk