Forum Discussion

Sammie_K's avatar
Sammie_K
New Member
1 year ago
Solved

Dynamic column

I am working on an aging report. I would like to have a column in my table with due/outstanding days. These days should change based on a selection in the report. e.g, when someone selects an earlier...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Sammie_K 

     

    Here I create a set of sample:

    Table:

    Then add 3 measures:

    Date = DATE(2024,9,8) //you can change the input date by edit the measure
    Diff =
    DATEDIFF ( MAX ( 'Table'[Date] ), 'Table1'[Date], DAY )
    //Calculate how many days apart the two dates are
    range =
    IF (
        'Table1'[Diff] < 31,
        "<30 Days",
        IF (
            'Table1'[Diff] > 30
                && 'Table1'[Diff] < 61,
            "31-60 Days",
            IF (
                'Table1'[Diff] > 60
                    && 'Table1'[Diff] < 91,
                "61-90 Days",
                IF ( 'Table1'[Diff] > 90, ">90 Days" )
            )
        )
    )
    

    The result is as follow:

     

     

    Best Regards

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