Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

How to get the difference between two days column with one column having dynamic value

Hi all,

I have made two columns, no. of days which is the difference between start date and end date and the total number of days, the first value in total number of days is the total of no. of days, the second value is the difference between total days and no. of days but the third value should come from the new total days -  no. of days and so on. I made a calculated column which is

SUM([No. of days])- 'ABCTable'[No. of days], but this is calculating the new values always as 2586-30, 2586-31, not as shown in the excel, it should calculate as 2586-30 for first value and 2556-31 for second  value, can anybody help me please.
Any help will be appreciated.
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hello @deekshasingh,

    Sounds like a mobile calculation requirement, maybe you can try to set the filter condition no less than or equal to the current index, then these calculations should be rolling in the current and previous records.

    If you are still confused about the encoding formula, please share some dummy data then we can try it.

    How to get answers to your question quickly
    Best regards

    Xiaoxin Sheng

2 Replies

  • For each "row" in your virtual table (filter context) you need to compute all previous "row" values since they depend on each other.

     

    Provide sample data in usable form and show expected outcome so we can suggest an appropriate aggregation function (like SUMX) to accomplish that.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello @deekshasingh,

    Sounds like a mobile calculation requirement, maybe you can try to set the filter condition no less than or equal to the current index, then these calculations should be rolling in the current and previous records.

    If you are still confused about the encoding formula, please share some dummy data then we can try it.

    How to get answers to your question quickly
    Best regards

    Xiaoxin Sheng