Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Sum a multiplication with if

Hi everyone,    I am a newbie at Power BI, very used to Qlik but have to change software.  I have an issue with a formula of that type : sum(quantity*if(cost_a<>0;cost_a;cost_b)). To do that, I ha...
  • amitchandak's avatar
    amitchandak
    6 years ago

    Anonymous Try like. maxx

     sumx(SUMMARIZE(ARTICLES;ARTICLES[ART_code];"M1";maxx(ARTICLES;if('ARTICLES'[ART_PRI]<>0; 'ARTICLES'[ART_PRI];'ARTICLES'[ART_PRI_Exact]));
     "M2";sum('TRANSACTION'[V_qte]));[M1]*[M2])