Forum Discussion

Isaiahj09's avatar
Isaiahj09
Frequent Visitor
2 years ago
Solved

Calculating Running Total using Quick measure and am getting incorrect values

Hi All, I am calculating the running total using quick measures which is easy enough but I am getting incorrect values The Base Value is a measure called Total Revenue. The Field is Date which cont...
  • Ashish_Mathur's avatar
    2 years ago

    Hi,

    Try this approach

    1. Create a Calendar Table with calculated column for Year, Month name and Month number
    2. Sort the Month name by the month number
    3. Create a relationship (Many to One and Single) from the Date column of the Fact table to the Date column of the Calendar Table
    4. To your visual, drag Year and Month from the Calendar Table
    5. Write this measure
    Measure = CALCULATE([Total Revenue],datesbetween(calendar[date],edate(min(calendar[date]),-11),max(calendar[date])))

    Hope this helps.

  • Anonymous's avatar
    Anonymous
    2 years ago

    Thanks for the reply from Ashish_Mathur and vicky_  , please allow me to provide another insight:

    Hi, Isaiahj09 

    Can you tell me if your problem is solved? If yes, please accept their reply as solution.

    Your dax is currently working fine in my test environment, so I'm guessing that the reason why your run is not what you expect may be due to your "Total Revenue" measure, and here are my measurements:

     

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

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

     

    Total Revenue = SUM('Alteryx TB'[1])

     

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

     

    Please find the attached pbix relevant to the case.

     
    Of course, you can also try updating your desktop version to see if that solves the problem:
    Download Microsoft Power BI Desktop from Official Microsoft Download Center
     

    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.