Forum Discussion

batman's avatar
batman
Helper I
3 years ago
Solved

Rolling Total

Hello Everyone, 

 

I need some assistance with my rolling total, I have a date hierarchy and my rolling total works for days, months and quarters but for some strange reason once I role up the hierarchy to the year it shows only the last months rolling total for the year. 

 

Below is my formula 

 

Price Rolling Total =

CALCULATE ( SUM ( NewMeasures[Price]), DATESQTD('Calendar'[Date] ))


Thank you 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi batman ,

    You can create another new measure as below and put this new measure to replace the original measure onto the table visual as below screenshot...

    Measure = SUMX ( VALUES ('Calendar'[Date] ), [Price Rolling Total] ) 

    In addition, you can refer the following links to try to solve your problem...

    Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

    Dax for Power BI: Fixing Incorrect Measure Totals

     

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. And share the visual field settings as below screenshot. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community

    Best Regards

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi batman ,

    I updated your sample pbix file, please find the details in the attachment.

    1. Create a measure as below

    Measure = 
    SUMX (
        GROUPBY ( 'Calendar', 'Calendar'[Date].[Year], 'Calendar'[Date].[Quarter] ),
        [Rolling Cost Total QTD]
    )

    2. Put the above measure onto the matrix to replace the original measure [Rolling Cost Total QTD]

    Best Regards

7 Replies