Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Timeline Slicer Dynamic Period Selection

Hi All,

 

Our team needs help in a specific requirement of the customer.

We are using time slicer and the customer wants to use dynamic period from it.

We have to select the latest transaction within that period and apply some kpis and measures for each.

Is there any way we can achieve that?

 

Thanks!

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous ,

     

    Assume you have datetime column in fact table.

    Create an independent time slicer table.

    Then create a measure like below and add it to visual filter set value = 1.

    Measure = 
    var max_ = CALCULATE(MAX('Table'[datetime]),FILTER(ALLSELECTED('Table'),'Table'[datetime]>=MIN(Slicer[datetime])&&'Table'[datetime]<=MAX(Slicer[datetime])))
    return
    IF(SELECTEDVALUE('Table'[datetime])=max_,1,0)

    If I misunderstood your meaning, please show some sample data and expected result.

     

    Best Regards,

    Jay

2 Replies

  • Anonymous ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

    Appreciate your Kudos.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    Assume you have datetime column in fact table.

    Create an independent time slicer table.

    Then create a measure like below and add it to visual filter set value = 1.

    Measure = 
    var max_ = CALCULATE(MAX('Table'[datetime]),FILTER(ALLSELECTED('Table'),'Table'[datetime]>=MIN(Slicer[datetime])&&'Table'[datetime]<=MAX(Slicer[datetime])))
    return
    IF(SELECTEDVALUE('Table'[datetime])=max_,1,0)

    If I misunderstood your meaning, please show some sample data and expected result.

     

    Best Regards,

    Jay