Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Calculate/Visualize Time Duration Dynamically Based on Selected Values in Date Slicer / Row Context

Dear PBI Community Members, I have a data file about children in child care service: the table has service begin date ('entry_date') and service end date ('exit_date') for each child, or censoring d...
  • amitchandak's avatar
    2 years ago

    Anonymous , for that you need a measure like

     

    Sumx(Table,datediff( Max(selectedvalue(Date[Date]) , Table[Start Date]), Min(selectedvalue(Date[Date]) , Table[Exit Date]), Day))

     

    As this a measure, you need segmentation for frequency

     

    example

    Dynamic segmentation -Measure to Dimension conversion: https://youtu.be/gzY40NWJpWQ

     

    Also joins with the date table can be active or inactive based on the need, refer files if needed