Forum Discussion
Subtotal miscaculation using an IF function
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
Hello amitchandak , thanks for your time and reply.
- I found out this as a possible solution, the thing is that I couldn't been able to use it effectively.
- Youtube solution:
- amitchandak4 years agoSuper User
Anonymous , Try like
IF(HASONEVALUE('PLANNED HOURS'[QD. TAG]),
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))
,
((SUM('PLANNED HOURS'[MAINTENANCE BUDGET]) - SUM('WORK_ORDER_CODING_UIV'[MAINTENANCE COST]) - SUM('PLANNED HOURS'[MAINTENANCE BUDGET DM]))*0.5)
)or you have use summarize to get more than one column to group
- Anonymous4 years agoNot applicable
- v-zhangti4 years agoCommunity Support
Hi, Anonymous
If the above response does not solve your problem. Can you provide easy to use PBIX files for testing? What kind of results do you expect? You can mark it in the screenshot. Looking forward to your reply.
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.