Forum Discussion

theo's avatar
theo
Helper III
9 years ago
Solved

measure

i would like to know how to call out another measure to use in another measure.

i have created below:

count_product = SUMX(all('table'[column1]),calculate(COUNT('table'[Column1])))

and

cumulative sum= SUMX(FILTER(ALL([count_product]),[count_product]<=max([count_product])),[count_product])

  • Hope this helps! :smileyhappy:

     

    New Table =
    SUMMARIZE (
        'Table',
        'Table'[Type],
        "Count of Type", COUNTROWS ( 'Table' ),
        "Type Rank by Count", RANKX ( ALL ( 'Table'[Type] ), CALCULATE ( COUNTROWS ( 'Table' ) ) )
    )
    
    Cumulative Sum Column =
    CALCULATE (
        SUM ( 'New Table'[Count of Type] ),
        FILTER (
            'New Table',
            'New Table'[Type Rank by Count] <= EARLIER ( 'New Table'[Type Rank by Count] )
        )
    )

     

    Continued here...

    http://community.powerbi.com/t5/Desktop/cumulative-sum/m-p/136762/highlight/false#M58688

13 Replies

    • theo's avatar
      theo
      Helper III

      Here is the visual of my data.  the last column is the one that i am trying to create.

      i tried the summarize but then there is an error that says about max when i used the column defined in the summarize

       

      Type

      count_product

      Cumulative sum
      1500500
      3330830
      22201050
      • Sean's avatar
        Sean
        Community Champion

        Hope this helps! :smileyhappy:

         

        New Table =
        SUMMARIZE (
            'Table',
            'Table'[Type],
            "Count of Type", COUNTROWS ( 'Table' ),
            "Type Rank by Count", RANKX ( ALL ( 'Table'[Type] ), CALCULATE ( COUNTROWS ( 'Table' ) ) )
        )
        
        Cumulative Sum Column =
        CALCULATE (
            SUM ( 'New Table'[Count of Type] ),
            FILTER (
                'New Table',
                'New Table'[Type Rank by Count] <= EARLIER ( 'New Table'[Type Rank by Count] )
            )
        )

         

        Continued here...

        http://community.powerbi.com/t5/Desktop/cumulative-sum/m-p/136762/highlight/false#M58688