Forum Discussion

aymankh's avatar
aymankh
Regular Visitor
4 years ago
Solved

Completed date for Projects

Hi, For the table (dummy values) shown below  I am trying to create a pie chart for a list of projects which are in progress or completed. I am facing an issue in doing the same since I want the pi...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi aymankh ,

     

    Based on this——how I can create a filter or query which only shows the current-in progress projects and the current completed projects (which may have started anytime before 2022). 

     

    Let's assume the "current-in" means the current month( March 2022), so for the data you provided, A, D, E should be shown in visual, right?

     

    Please try to create a flag measure:

    Flag = 
    var _startDiff=DATEDIFF(MAX('Table'[Start date ]),TODAY(),MONTH)
    var _compDiff=DATEDIFF(MAX('Table'[Completed date]),TODAY(),MONTH)
    return IF(_startDiff=0 && MAX('Table'[Completed date])=BLANK() || MAX('Table'[Completed date])<>BLANK()&& _compDiff=0 ,1,0)

    And then apply it to visual-filter pane, below is the output:

     

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