Forum Discussion

Kristianhk's avatar
Kristianhk
Frequent Visitor
6 years ago
Solved

graph with dynamic start and end form selected row

Hey Guys I have tried to make a solution and/or searching for on without any luck.   I have a dataset starttime and endtime  (datetime (datetime)) for each product ID from a machine.  I have anot...
  • v-alq-msft's avatar
    6 years ago

    Hi, Kristianhk 

     

    Based on your description, I created data to reproduce your scenario.

    Table:

    DateTable:

     

    DateTable = CALENDARAUTO()

     

     

    Then you may create a measure as follows.

     

    IsDisplay = 
    var _currentproduct = SELECTEDVALUE('Table'[Product ID])
    var _currentdate = MIN(DateTable[Date])
    
    return
    IF(
            _currentproduct<>BLANK(),
            IF(
                _currentdate <= VALUES('Table'[endtime])&&
                _currentdate >= VALUES('Table'[starttime]),
                1,
                0
            )
    )

     

     

    Finally, you may put the measure in the visual level filter. Here is the result.

     

    If I misunderstand your thought, please show me your sample data and expected output. Do mask sensitive data before uploading. I am glad to solve the problem for you.

     

    Best Regards

    Allan

     

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