Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

cumulative sum with one value

Hello all,

 

I am trying to make a cumulative sum with one value is that possible ?

Dataset : 


the idea is to have a linear curve like this : 
the first point will be 876 935, the second one 876 935*2, the third 876 935*3 etc. 

I tried this but not working : 

Thanks

5 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Anonymous Try the Running Total quick measure built into Power BI Desktop. 

    Sum of Column1 running total in Date = 
    CALCULATE(
    	SUM('Table7'[Column1]),
    	FILTER(
    		ALLSELECTED('Dates'[Date]),
    		ISONORAFTER('Dates'[Date], MAX('Dates'[Date]), DESC)
    	)
    )
    • Anonymous's avatar
      Anonymous
      Not applicable

      thank you for trying but it's not working. 

      I got this result ( the orange line)

       

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

        Hi Anonymous 

         

        Can you share a fomula you used to create this chart (how did you add Greg solution to your report)?

         


        Appreciate your Kudos!!
        LinkedIn: 
        www.linkedin.com/in/vahid-dm/

         

         

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous,

    AFAIK, selectedvalue function does not suitable to handle aggregate row context. If you not setting 'alternate result', it will return blank when this function works with aggregate contents.

    SELECTEDVALUE function - DAX | Microsoft Docs

    For this scenario, I'd like to suggest you do some process to add variables with summarize function to manually group and calculate records with these categories at the detail level. Then you can invoke this measure with other formula calculations.

    BTW, if this calculation includes multiple aggregations. You may need also to set multiple level aggregations in the formulas. (use summarize function calculates the first level, then use iterator function to summary previous results)
    Regards,

    Xiaoxin Sheng