Forum Discussion

Juju123's avatar
Juju123
Icon for Helper III rankHelper III
2 years ago
Solved

Sumx not return good total

Hi, 

I have a problem with SUMX fonction. I have a table in which i want to sum calculated column. 

I create a DAX formula for calculated column : 

TEST = IF([Measure]<>0,1,0)

Then i want to have the sum of this calculated column but it's not work. Power BI return blank value in sum and i don't understand :

Sum Test = SUMX(CAGC_MFG_ECART_PDC_PPPI_REP,[TEST])

 

Can you explain me why i have not "Total" for column "Test" and why column "Sum test" return blank value while there are value in column "Test" ? 

 

Thanks

 

17 Replies

  • Hello Juju123 ,

     

    Please check the data type of your measure and if it is general or text change it to whole number that may help you in acheiving your requirement.

     

    If this post helps, then please consider accepting it as the solution to help other members find it more quickly. Thank You!!

  • I think you are confusing between measures and calculated columns.  Share some data, explain the question and show the expected result.

    • Juju123's avatar
      Juju123
      Icon for Helper III rankHelper III

      Hi Ashish_Mathur ,

      In fact I want to display the reference number according to the selection made by the user.

      User has several filters.
      Depending on the filters that it will select, I must display the reference number which is displayed in a card.

      Currently I have this table but the final result I have in the table does not match and the result I have in my map does not match also.

       

      For example, to test that my measurement works, I selected the year 2023 in my data.
      My table shows me 94 lines but my measure calculate 195 references. I think my measure

       

      I create this Dax formula (it's measure column) : 

       

      Nb Ref. = DISTINCTCOUNT(TABLE[Ref.])

       

      This Dax column depend on this calculated column

       

      Ref. = REF&"-"LIGNES_NUMBER

       

      Sorry but i can't attach pbix file in my comment. When i want to share pbix, i have this error The file type (.pbix) is not supported.

       

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Icon for Super User rankSuper User

        Upload the file to One Drive and share the download link of the PBI file.