Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Cumulative DAX Measure Error

Hi Experts

 

I cannot see the error in my cumulative DAX Measure - See sample data. The first table in the below give the standard hourly units sold in the second table i am trying to work out the cumulative sale.....

 

https://www.dropbox.com/s/fc0x835a4tgxnx1/Tes.pbix?dl=0 

  • Hi, Anonymous 

     

    1. if you want to use ALL function, then please try to only remove the filter for the specific column. If you use ALL function for the whole table, I think it will also remove the filter for currency.

    2. for the specific currency, there is no result for the calculated column. In order to do cumulative calculation, please try to use another column in another table that represents the hour.

    3. Because you said do not upload the file, I don't upload the file. I just suggest like above.

     

    thanks.

9 Replies

  • Hi, Anonymous 

    I am not sure if I understood your question correctly, but please check the below picture and the sample pbix file's link down below.

     

    Number of units sold =
    SUMX(FACTSalesOrderTable,1)
     
    Number of unit sold cumulate =
    CALCULATE (
    [Number of units sold],
    FILTER (
    ALL ( FACTSalesOrderTable ),
    FACTSalesOrderTable[Created_Hour] <= MAX ( FACTSalesOrderTable[Created_Hour] )
    )
    )
     
     

    Hi, My name is Jihwan Kim.


    If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


    Linkedin: linkedin.com/in/jihwankim1975/

    Twitter: twitter.com/Jihwan_JHKIM

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Kim. Can you do the Cumulative of the sum of the Created hours in the first table....

      • Jihwan_Kim's avatar
        Jihwan_Kim
        Super User

        Hi, Anonymous 

        I could not.

        Because it is an implicit measure and I could not do the cumulative sum by using the implicit measure.

        And I did not understand what was the meaning of that implicit measure. It was just summing the numbers. I could understand it if the implicit measure was COUNT. However, I could not understand what was the meaning of SUM. 

        If you still want to calculate the cumulative, then I suggest creating the explicit measure and use this to create the cumulate calculation. 

         

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hold on - ignore last message.

      • Jihwan_Kim's avatar
        Jihwan_Kim
        Super User

        Hi, Anonymous 

         

        1. if you want to use ALL function, then please try to only remove the filter for the specific column. If you use ALL function for the whole table, I think it will also remove the filter for currency.

        2. for the specific currency, there is no result for the calculated column. In order to do cumulative calculation, please try to use another column in another table that represents the hour.

        3. Because you said do not upload the file, I don't upload the file. I just suggest like above.

         

        thanks.