Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Bonjour,
je débute avec PowerBI et je rencontre un problème sur les totaux.
J'ai une colonne "quantité de produits en-commande", une colonne "Prix Unitaire" et je souhaite multiplier ces 2 colonnes pour avoir la valeur de l'encommande par article.
Je fais la somme de cette 3ème colonne et je me retrouve avec un total qui est faux (38 milliards d'en commande)
Pourriez vous m'aider svp ?
Solved! Go to Solution.
@thecheck06,
Please create a measure v_web_commande_product table, drag the Item_id field and the new measure to the visual below.
Measure = IF(COUNTROWS(VALUES(v_web_commande_product[item_id]))=1,[ValEnCde],sumx(VALUES(v_web_commande_product[item_id]),[ValEnCde]))
Regards,
Lydia
@thecheck06,
This is english forum, please post question in English. I translator your question into English using Bing translator, and it seems that you get wrong total value for the ValEncde column.
In your sceanrio, you can create a measure using Dax below.
Measure 2 = SUMX(Table, MAX(Table[PA Moyen HT])*MAX(Table[EnCde]))
Regards,
Lydia
Sorry for my french answer 😞
Thanks for your fix but result is not ok.
Please, could you see new print-screen please ?
@thecheck06,
Could you please share sample data of your original table so that I can test? You can share sample data following the guide in this blog below.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Regards,
Lydia
This is a sample of my datas :
SKU;Nom;floc;Nb Cmd;prd;Vente HT;Total PMP;Stock;Qté;PA Moyen HT;EnCde;ValEnCde
A1;Product 1;Non;234;167;10 432 €;4 841 €;611 €;26;€ 23,50;300;7 050 €
A2;Product 2;Non;10;13;939 €;888 €;19 668 €;288;€ 68,29;100;6 829 €
A3;Product 3;Oui;22;28;3 384 €;1 912 €;33 326 €;488;€ 68,29;100;6 829 €
A4;Product 4;Non;245;262;26 462 €;17 892 €;33 326 €;488;€ 68,29;100;6 829 €
A5;Product 5;Oui;592;622;73 158 €;42 476 €;33 326 €;488;€ 68,29;100;6 829 €
A6;Product 6;Non;7;9;510 €;456 €;12 355 €;298;€ 41,46;100;4 146 €
A7;Product 7;Oui;24;19;1 681 €;829 €;16 377 €;395;€ 41,46;100;4 146 €
A8;Product 8;Non;1;1;87 €;41 €;4 022 €;97;€ 41,46;100;4 146 €
A9;Product 9;Oui;7;8;1 060 €;332 €;16 294 €;393;€ 41,46;100;4 146 €
A10;Product 10;Non;78;89;5 781 €;3 690 €;17 289 €;417;€ 41,46;100;4 146 €
A11;Product 11;Oui;48;33;3 343 €;1 368 €;17 289 €;417;€ 41,46;100;4 146 €
A12;Product 12;Non;3181;3562;212 142 €;147 681 €;17 289 €;417;€ 41,46;100;4 146 €
A13;Product 13;Oui;1556;1324;108 957 €;54 893 €;17 289 €;417;€ 41,46;100;4 146 €
A14;Product 14;Non;128;119;8 502 €;4 934 €;20 357 €;491;€ 41,46;100;4 146 €
A15;Product 15;Oui;306;273;21 736 €;11 319 €;20 357 €;491;€ 41,46;100;4 146 €
A16;Product 16;Non;769;842;55 439 €;36 402 €;16 377 €;395;€ 41,46;100;4 146 €
A17;Product 17;Oui;1224;1347;105 557 €;56 427 €;16 377 €;395;€ 41,46;100;4 146 €
A18;Product 18;Non;1;1;75 €;41 €;912 €;22;€ 41,46;100;4 146 €
A19;Product 19;Oui;3;6;529 €;249 €;4 934 €;119;€ 41,46;100;4 146 €
A20;Product 20;Oui;6;18;631 €;615 €;11 440 €;335;€ 34,15;100;3 415 €
A21;Product 21;Non;56;86;4 083 €;2 937 €;11 440 €;335;€ 34,15;100;3 415 €
A22;Product 22;Oui;161;245;16 455 €;8 367 €;11 440 €;335;€ 34,15;100;3 415 €
A23;Product 23;Non;7;9;662 €;410 €;11 881 €;348;€ 34,14;100;3 414 €
A24;Product 24;Oui;61;62;5 183 €;2 117 €;15 295 €;448;€ 34,14;100;3 414 €
A25;Product 25;Non;739;846;43 770 €;29 872 €;15 295 €;448;€ 34,14;100;3 414 €
A26;Product 26;Oui;2802;3125;219 107 €;107 643 €;15 295 €;448;€ 34,14;100;3 414 €
A27;Product 27;Non;47;47;3 627 €;2 115 €;18 000 €;400;€ 45,00;50;2 250 €
A28;Product 28;Oui;103;102;8 324 €;4 635 €;18 000 €;400;€ 45,00;50;2 250 €
A29;Product 29;Non;27;28;2 423 €;956 €;3 688 €;108;€ 34,15;54;1 844 €
A30;Product 30;Oui;19;23;2 052 €;785 €;3 688 €;108;€ 34,15;54;1 844 €
A31;Product 31;Oui;14;13;2 018 €;780 €;14 640 €;244;€ 60,00;30;1 800 €
A32;Product 32;Non;177;130;12 009 €;7 860 €;26 040 €;434;€ 60,00;30;1 800 €
A33;Product 33;Oui;381;311;31 462 €;18 660 €;26 040 €;434;€ 60,00;30;1 800 €
A34;Product 34;Non;84;62;3 039 €;545 €;1 580 €;200;€ 7,90;200;1 580 €
A35;Product 35;Non;48;44;3 798 €;1 980 €;18 000 €;400;€ 45,00;30;1 350 €
A36;Product 36;Oui;71;84;7 275 €;3 780 €;18 000 €;400;€ 45,00;30;1 350 €
A37;Product 37;Non;2;3;140 €;75 €;1 258 €;50;€ 25,15;50;1 258 €
A38;Product 38;Non;173;195;10 636 €;5 030 €;5 030 €;200;€ 25,15;50;1 258 €
A39;Product 39;Non;1;1;78 €;35 €;9 310 €;266;€ 35,00;30;1 050 €
A40;Product 40;Oui;4;5;431 €;175 €;19 390 €;554;€ 35,00;30;1 050 €
A41;Product 41;Non;235;265;20 767 €;9 345 €;43 750 €;1250;€ 35,00;30;1 050 €
A42;Product 42;Oui;790;916;74 777 €;32 095 €;43 750 €;1250;€ 35,00;30;1 050 €
A43;Product 43;Non;19;20;1 524 €;976 €;5 707 €;117;€ 48,78;18;878 €
A44;Product 44;Non;231;210;11 400 €;1 492 €;878 €;150;€ 5,85;150;878 €
A45;Product 45;Non;2;1;157 €;6 €;878 €;150;€ 5,85;150;878 €
A46;Product 46;Non;28;34;1 331 €;576 €;16 €;1;€ 16,45;50;823 €
A47;Product 47;Non;1;1;106 €;16 €;16 €;1;€ 16,45;50;823 €
A48;Product 48;Non;27;28;2 542 €;751 €;1 556 €;58;€ 26,83;30;805 €
A49;Product 49;Non;;1;;16 €;318 €;20;€ 15,90;50;795 €
A50;Product 50;Non;146;153;6 455 €;2 528 €;1 113 €;70;€ 15,90;50;795 €
A51;Product 51;Non;12;11;1 071 €;295 €;912 €;34;€ 26,83;29;778 €
A52;Product 52;Non;3;2;267 €;50 €;1 509 €;60;€ 25,15;30;755 €
A53;Product 53;Non;243;258;15 095 €;6 539 €;2 465 €;98;€ 25,15;30;755 €
A54;Product 54;Non;261;134;4 931 €;1 098 €;747 €;100;€ 7,47;100;747 €
A55;Product 55;Non;2;1;165 €;7 €;747 €;100;€ 7,47;100;747 €
A56;Product 56;Non;245;234;11 192 €;3 456 €;144 €;10;€ 14,40;50;720 €
A57;Product 57;Non;14;13;436 €;187 €;144 €;10;€ 14,40;50;720 €
A58;Product 58;Non;36;32;1 719 €;460 €;719 €;50;€ 14,38;50;719 €
A59;Product 59;Non;1;1;72 €;35 €;1 356 €;39;€ 34,76;20;695 €
A60;Product 60;Non;70;65;670 €;455 €;644 €;99;€ 6,50;100;650 €
A61;Product 61;Non;54;64;2 551 €;455 €;644 €;99;€ 6,50;100;650 €
A62;Product 62;Non;59;54;1 801 €;397 €;650 €;100;€ 6,50;100;650 €
A63;Product 63;Non;1;1;34 €;7 €;644 €;99;€ 6,50;100;650 €
A64;Product 64;Non;10;5;159 €;33 €;650 €;100;€ 6,50;100;650 €
A65;Product 65;Non;54;50;2 281 €;545 €;545 €;50;€ 10,90;50;545 €
A66;Product 66;Non;1;1;106 €;11 €;545 €;50;€ 10,90;50;545 €
A67;Product 67;Non;9;10;567 €;317 €;1 205 €;38;€ 31,71;16;507 €
A68;Product 68;Non;29;29;2 576 €;778 €;993 €;37;€ 26,83;18;483 €
A69;Product 69;Non;43;58;3 319 €;1 583 €;2 495 €;93;€ 26,83;18;483 €
A70;Product 70;Non;70;76;5 323 €;2 039 €;2 495 €;93;€ 26,83;18;483 €
A71;Product 71;Non;4;5;481 €;171 €;922 €;27;€ 34,15;10;342 €
A72;Product 72;Oui;22;24;2 390 €;820 €;922 €;27;€ 34,15;10;342 €
A73;Product 73;Non;74;60;2 534 €;358 €;289 €;50;€ 5,78;50;289 €
A74;Product 74;Non;11;11;1 631 €;349 €;190 €;6;€ 31,71;9;285 €
A75;Product 75;Non;2;1;147 €;30 €;30 €;1;€ 30,00;9;270 €
A76;Product 76;Oui;1;2;309 €;60 €;2 220 €;74;€ 30,00;9;270 €
A77;Product 77;Non;174;183;13 554 €;5 520 €;3 870 €;129;€ 30,00;9;270 €
A78;Product 78;Oui;103;112;8 279 €;3 360 €;4 770 €;159;€ 30,00;9;270 €
A79;Product 79;Non;54;64;4 225 €;2 695 €;2 322 €;56;€ 41,46;6;249 €
A80;Product 80;Oui;17;20;1 401 €;829 €;2 073 €;50;€ 41,46;6;249 €
A81;Product 81;Non;43;45;1 860 €;300 €;780 €;117;€ 6,67;34;227 €
A82;Product 82;Non;6;7;648 €;47 €;780 €;117;€ 6,67;34;227 €
A83;Product 83;Non;5;6;422 €;222 €;406 €;11;€ 36,93;6;222 €
A84;Product 84;Non;49;57;6 459 €;4 317 €;1 756 €;24;€ 73,17;3;220 €
A85;Product 85;Non;1;1;136 €;73 €;659 €;9;€ 73,17;3;220 €
A86;Product 86;Non;2;3;140 €;17 €;1 051 €;191;€ 5,50;37;204 €
A87;Product 87;Non;2;2;291 €;22 €;1 051 €;191;€ 5,50;37;204 €
A88;Product 88;Non;346;376;33 871 €;2 624 €;1 051 €;191;€ 5,50;37;204 €
A89;Product 89;Non;118;123;6 891 €;677 €;1 051 €;191;€ 5,50;37;204 €
A90;Product 90;Non;71;70;3 965 €;385 €;1 051 €;191;€ 5,50;37;204 €
A91;Product 91;Non;1;1;20 €;4 €;308 €;77;€ 4,00;50;200 €
A92;Product 92;Non;115;128;4 826 €;540 €;140 €;35;€ 4,00;50;200 €
A93;Product 93;Non;146;164;6 476 €;684 €;308 €;77;€ 4,00;50;200 €
A94;Product 94;Non;69;65;2 741 €;561 €;332 €;39;€ 8,50;20;170 €
A95;Product 95;Non;65;71;6 394 €;1 440 €;2 220 €;111;€ 20,00;8;160 €
A96;Product 96;Non;2;2;330 €;40 €;960 €;48;€ 20,00;8;160 €
A97;Product 97;Non;1;1;225 €;138 €;0 €;0;€ 138,46;1;138 €
A98;Product 98;Non;1;1;236 €;138 €;0 €;0;€ 138,46;1;138 €
A99;Product 99;Non;1;1;163 €;138 €;0 €;0;€ 138,46;1;138 €
@thecheck06,
Please create the following measures in your table.
Measure1 = MAX(ERP_PRODUCT[PA Moyen HT])*MAX(ERP_PRODUCT[EnCde])
Measure = SUMX(ERP_PRODUCT,[Measure1])
Regards,
Lydia
Thanks Lydia,
unfortunatly, total is different but wrong.
First total (Measure1) : 50000€
Second total (Measure) : 60000€
Right total if I export data in Excel : 190000€
@thecheck06,
I am unable to reproduce this issue using your sample data. Please check attached PBIX file.
If you still have questions, please share PBIX file for me to test.
Regards,
Lydia
=> PM 😉
@thecheck06,
Please create a measure v_web_commande_product table, drag the Item_id field and the new measure to the visual below.
Measure = IF(COUNTROWS(VALUES(v_web_commande_product[item_id]))=1,[ValEnCde],sumx(VALUES(v_web_commande_product[item_id]),[ValEnCde]))
Regards,
Lydia
User | Count |
---|---|
94 | |
83 | |
78 | |
75 | |
66 |
User | Count |
---|---|
115 | |
105 | |
93 | |
65 | |
62 |