Forum Discussion

dbattin4's avatar
dbattin4
Frequent Visitor
9 months ago
Solved

Running Total Measure Won't Work With Filters

I have a running total Measure that is working

Revenue Budget Running Total =
 CALCULATE(
 SUMX(BudgetByProduct,[REVENUE_BUDGET]),
 FILTER(ALLSELECTED('Calendar'[global_date]),'Calendar'[global_date]<=MAX('Calendar'[global_date])
 ))
 
But when I apply a filter to this measure I don't get any results and I can't see why
Budget IRT RT =
CALCULATE([Revenue Budget Running Total],
FILTER(BudgetByProduct,BudgetByProduct[ProductOrigin]="IRT"))
 
Have looked at many solutions but none have worked to date
  • I have resolved this by changing the order of the creation of the measures.

    Created a filtered sum then created another measure for the running total of that sum


7 Replies

  • ThomasWeppler's avatar
    ThomasWeppler
    Impactful Individual

    Hi dbattin4

    Why does one of your calculations use allselected and the other doesn't?
    Allselected() remove all filters but the ones you have specificly selcted, so I just think you need to deleted that from your DAX and it should work fine.

  • Hi dbattin4 ,

     

    Without any further information or example is difficult to give you the exact problem. Not sure what you are using this calculation for but have you tried the visual calculations, there is a running sum that will be applied to the visual you are working with.

     

    https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-visual-calculations-overview

     

    But if you want to reuse this one for sure you need a measure.

     

    Can you please share a mockup data or sample of your PBIX file. You can use a onedrive, google drive, we transfer or similar link to upload your files.

    If the information is sensitive please share it trough private message.

    • dbattin4's avatar
      dbattin4
      Frequent Visitor

      I have resolved this by changing the order of the creation of the measures.

      Created a filtered sum then created another measure for the running total of that sum


      • MFelix's avatar
        MFelix
        Super User

        Hi Praful_Potphode ,

         

        Glad you were able to solve it don't forget to accept as solution the correct answer so it can help others, even if it is yours.

  • Hi dbattin4 

     

    as mentioned by MFelix  please provide more information on input/output.

    i tried replicating your measures in PBI desktop.

    Most of them are working fine.the only time you will get blank for the second measure is when you select anything else than "IRT".Sample PBIX can be donwloaded from here.

     

     

    Please give Kudos or mark it as solution once confirmed.

     

    Thanks and Regards,

    Praful

  • Hi dbattin4,

    Since your issue has been resolved, kindly mark the helpful reply as the solution. This will assist other members who may encounter similar issue.

     

    Thank you.