Facts

The appellant, [A.X. SA] , and [B.X. SA] are sister companies with their registered office in Montana. [A.X. SA] owns the building that it leases to [B.X. SA] , which operates it. The financial year of both companies begins on 1 June.

As at 31 May 2006, [B.X. SA] recorded an expense of CHF 500'000 under the heading 'premises expense'. The same amount was recorded by [A.X. SA] as income, under the heading 'restructuring contribution'. In a report dated 10 October 2010, the expert of the Valais Cantonal Tax Administration considered it unlikely that a third party would have agreed to this waiver of debt during the 2005/2006 financial year. It was therefore a so-called improper restructuring, not justified by commercial usage, and CHF 500'000 had to be added to the taxable profit of [B.X. SA] for the 2006 tax period.

By assessment decision of 11 November 2011, confirmed on objection on 30 September 2013, the cantonal tax authority included this amount in the taxable profit of [B.X. SA] . Both companies appealed to the Cantonal Tax Appeals Commission of the canton of Valais.

By merger agreement of 25 November 2013, [A.X. SA] absorbed [B.X. SA] with effect from 30 November 2013, with ex lege transfer of assets and liabilities.

By decision of 17 December 2014, notified on 11 August 2015, the Appeals Commission dismissed the appeal. It held that the amount had been recorded in exchange for a reduction of a debt owed to [B.X. SA] , that the rents collected corresponded to a normal rent not justifying any supplement, and that [A.X. SA] was in a difficult financial situation, its banks having demanded repayment of the loans in 1999 and the rents having to be paid directly to the debt enforcement office.

Acting by way of public law appeal, [A.X. SA] seeks reform of the decision, requesting that the waiver of debt of CHF 500'000 be maintained as an expense, thereby reducing the taxable net profit of [B.X. SA] . The Federal Tax Administration seeks dismissal of the appeal. The cantonal authorities declined to submit observations.

The dispute concerns whether the amount of CHF 500'000 constituted an expense not justified by commercial usage for the 2006 tax period of [B.X. SA] , and therefore a hidden profit distribution for the purposes of federal direct tax, cantonal and communal tax.

Considerations

On admissibility, the Federal Supreme Court accepts that a single decision concerning both federal direct tax and cantonal and communal tax is admissible, the legal question being resolved in the same way under federal law and harmonised cantonal law (ATF 135 II 260). Cases 2C_798/2015 and 2C_799/2015 are joined because of the identity of the facts and the overlap of the legal questions (art. 71 FSCA and 24 APA).

The appellant has standing to appeal as the absorbing company that took over the assets and liabilities of [B.X. SA] by merger (art. 22 para. 1 MergA, art. 89 para. 1 FSCA). On the merits, art. 58 para. 1 let. b DFTA excludes from deduction hidden profit distributions and advantages procured to third parties not justified by commercial usage. Case law requires four cumulative conditions: a benefit without a corresponding counter-performance, granted to a shareholder or a person close to him, which would not have been granted to a third party under the same conditions, and a manifest disproportion between benefit and counter-performance (ATF 140 II 88; ATF 138 II 57). It must be verified whether the principle of arm's length dealing (dealing at arm's length, ATF 138 II 545) has been respected.

In this case, the lower authority established, in a manner binding on the Federal Supreme Court (art. 105 para. 1 FSCA), that the rent was in conformity with the market and…