Forum Discussion

fengwufangzhu's avatar
fengwufangzhu
Frequent Visitor
2 years ago
Solved

Summarize Running Total or YTD

Hi All,

I am stuck for a while on this and also tried to google around.

I have a set of raw revenue data by site and by month. I need to get the cumulative running total and bring it to another table using summarize function (in order to union with other scorecard metrics for some other purpose).

SiteMonthRevenue
AJan 2410
AFeb 2430
BJan 245
BFeb 242

Yes I can calculate cumulative running total using either quick measure or YTD function, it is working fine on original table. However once I summarize and bring to another table, the cumulative is not working and only showing monthly data.

What I need: A new summarised table with cumulative revenue

SiteMonthYTD Revenue
AJan 2410
AFeb 2440
BJan 245
BFeb 247
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi,fengwufangzhu 

    Regarding the issue you raised, my solution is as follows:

    1.First I have created the following table and the column names and data are the data you have given:

    2. Below are the Calculated Columns I've created for your needs:

    YTD Revenue = SUMX(FILTER(ALLSELECTED('Table'),'Table'[Site]=EARLIER('Table'[Site])&&'Table'[Month]<=EARLIER('Table'[Month])),'Table'[Revenue])

    3.If you want the visualization objects in the other table to display correctly as well, I hope you can check that the relationship between your two tables meets your requirements, in my example I have created an index column and related the two tables with this.

    4.Here's my final result, which I hope meets your requirements.

    Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
    Please find the attached pbix relevant to the case.

    Best Regards,

    Leroy Lu

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

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,fengwufangzhu 

    Regarding the issue you raised, my solution is as follows:

    1.First I have created the following table and the column names and data are the data you have given:

    2. Below are the Calculated Columns I've created for your needs:

    YTD Revenue = SUMX(FILTER(ALLSELECTED('Table'),'Table'[Site]=EARLIER('Table'[Site])&&'Table'[Month]<=EARLIER('Table'[Month])),'Table'[Revenue])

    3.If you want the visualization objects in the other table to display correctly as well, I hope you can check that the relationship between your two tables meets your requirements, in my example I have created an index column and related the two tables with this.

    4.Here's my final result, which I hope meets your requirements.

    Can you share sample data and sample output in tabular format if I am misunderstanding? Or a sample pbix after removing sensitive data. We can better understand the problem and help you.
    Please find the attached pbix relevant to the case.

    Best Regards,

    Leroy Lu

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

    • fengwufangzhu's avatar
      fengwufangzhu
      Frequent Visitor

      Thank you very much. Creating a new column using SUMX and Earlier did the magic. I then use SUMMARIZE that brings cumulative number into new table.

      Relationship not required for my context as I need a totally independent new table.