Forum Discussion

Mikeincairns's avatar
Mikeincairns
Frequent Visitor
1 year ago
Solved

Help with Date/Time Intelligence

I need to know if a process was active within a date period, selected by a Timeline slicer.
I have a 4 step process.  Each row represents the process, and I have one column for each step completion date.

Data Model consists of Transaction table and Date table (currently unjoined): 


I want to select (say) Q1/2024 and filter all the records in the table that were active in that period.  Note: Q1 is 01/01/2024 - 31/3/2024.
If the process was started prior to Q1/2024, but not finished, then it is still active.

Pivot Table is as shown with the desired result. 

Could someone guide me to the logic of solving this problem.

Any help would be greatly appreciated.  I dont even know how to start thinking about it.

  • Mikeincairns 
    Please try with this measure:
    Logic: if the process ended before the "min date selected at the slicer" or the process started after the "max date selected at the slicer" then it returns N otherwise Y.

    Steps =
    VAR _MaxSelected = MAXX ( ALLSELECTED ( Calendar), Calendar[Date] )
    VAR _MinSelected = MINX ( ALLSELECTED ( Calendar), Calendar[Date] )
    RETURN
        IF ( tblExtract[Step 4] < _MinSelected || tblExtract[Step 1] > _MaxSelected,
            "N", "Y")

     I hope this helps, if so please accept as a solution. Kudos are welcome๐Ÿ˜.

4 Replies

  • Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
    Do not include sensitive information. Do not include anything that is unrelated to the issue or question.
    Please show the expected outcome based on the sample data you provided.

    Need help uploading data? https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216
    Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

    • Mikeincairns's avatar
      Mikeincairns
      Frequent Visitor

      I am stuggling to explain what I want. 

      - It is confidential data so will not be uploading.
      - Pretty sure I have provided the sample data (albeit in a screenshot).
      - I have taken out sensitive and unrelated data.
      - I have a sample of the expected outcome.
      Not sure what else to do.  But I appreciate your feedback.

       

  • Mikeincairns 
    Please try with this measure:
    Logic: if the process ended before the "min date selected at the slicer" or the process started after the "max date selected at the slicer" then it returns N otherwise Y.

    Steps =
    VAR _MaxSelected = MAXX ( ALLSELECTED ( Calendar), Calendar[Date] )
    VAR _MinSelected = MINX ( ALLSELECTED ( Calendar), Calendar[Date] )
    RETURN
        IF ( tblExtract[Step 4] < _MinSelected || tblExtract[Step 1] > _MaxSelected,
            "N", "Y")

     I hope this helps, if so please accept as a solution. Kudos are welcome๐Ÿ˜.

    • Mikeincairns's avatar
      Mikeincairns
      Frequent Visitor

      Thanks for getting me in the right direction.
      I am finding it super hard to describe what I want, so dont want to waste anyones time.
      I will mark it as solved.
      Appreciate your reply veru much,  Thankyou.