Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Incremental into cumulative

Hi   I have been trying solutions but i just don't get it I want to do the following on Power BI   Like a sum with condition on date and on the the same product x lob I tried TotalYTD but...
  • v-robertq-msft's avatar
    4 years ago

    Hi, Anonymous 

    According to your description, I can roughly understand your requirement, you want to sum the "amount" if it's the same product and Lob for all valuation date anterior to the one in the line and create a slicer to filter the data based on the date column, right? I think you can create a measure to use the AllSelected() function instead of All() like this to achieve your requirement:

    Cumulative Amount 1 =
    
    CALCULATE(SUM('Table'[Amount]),FILTER(ALLSELECTED('Table'),[LoB]=MAX('Table'[LoB])&&[Valuation Date]<=MAX('Table'[Valuation Date])))
    
    

    And you can get what you want, like this:

     

    You can download my test pbix file below

    For more info about the Allselected() function in DAX, please refer to this link:

    https://docs.microsoft.com/en-us/dax/allselected-function-dax

     

    Thank you very much!

     

    Best Regards,

    Community Support Team _Robert Qin

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