Forum Discussion
Anonymous
6 years agoNot applicable
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...
- 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])
amitchandak
Super User
6 years agoAnonymous ,
Try like: sumx(Summmarize(Article[ArtCOde],"M1",maxx(Atricle,if(Art_pri<>0, art_prc,art_pri_excat)),"M2",sum(Trascation[]V_qty)),[M1]*[M2])
- Anonymous6 years agoNot applicable
Hi amitchandak ,
thank you for your answer. I am not sure I understood it. I put :
sumx(SUMMARIZE(ARTICLES;ARTICLES[ART_code];"M1";max(ARTICLES;if('ARTICLES'[ART_PRI]<>0; 'ARTICLES'[ART_PRI];'ARTICLES'[ART_PRI_Exact]));"M2";sum('TRANSACTION'[V_qte]));[M1]*[M2])but I have 2 errors :- cannot find one unique value for ART_PRI_Exact in talbe ARTICLES- cannot find the name ART_PRI and ART_PRI_Exact (fyi, Exact is the name of our ERP)thank you for your help !- amitchandak6 years ago
Super User
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])- Anonymous6 years agoNot applicable
Hi amitchandak
thank you for your quick answer ! 🙂 I had an error first with MAXX that's why I put only MAXX (did not understand there were 2 different functions, sorry). I have no more error on the measure but it can't be shown on the screen : there is another error "la fin de l'entrée a été atteinte" which could be translated by "the end of the entry has been reached". Any idea ?
thank you very much,
Delphine