Forum Discussion

WillAlexander's avatar
WillAlexander
Frequent Visitor
3 years ago
Solved

Returning Value based on MIN

Hi All,

 

I have a list of tasks that need to be completed. In my report I am wanting to display the next task that needs to be completed.

 

So I would need to find the Minimum Task number that has not been completed and return the value of the task but i'm unsure how to input this into a measure. 

 

NSWTender StrategyTermination1Completed
NSWTender StrategyIssue termination letter to Force Fire2Completed
NSWTender StrategyAsset List finalisation3Completed
NSWTender StrategySME Scope Presentation4Completed
NSWTender StrategyList of supplier5Completed
NSWTender StrategyRequirement gathering from State Ops & State Leads6Completed
NSWTender StrategyApproval7Completed
NSWTransitionComms to the suppliers for the tender outcome15 
NSWTransitionContract signing16 
NSWTransitionCommencing Transition17 
QLDTender StrategyAsset List finalisation1Completed
QLDTender StrategySME Scope Presentation2Completed
QLDTender StrategyList of supplier3Completed
QLDTender StrategyRequirement gathering from State Ops & State Leads4Completed
QLDTender StrategyApproval5Completed
QLDTransitionComms to the suppliers for the tender outcome13 
QLDTransitionContract signing14 
QLDTransitionCommencing Transition15 

 

I've calculated the next task through

Next Task =
CALCULATE(MIN('Tender Schedule'[Task]), FILTER('Tender Schedule', 'Tender Schedule'[Completed?]<>"Completed"))
 
Including Activities in a table shows the minimum of all activity types.
 
What I would want is to only show the next task (minimum task number) similar to the below.
 

 

  • ribisht17's avatar
    ribisht17
    3 years ago

    Hi WillAlexander 

     

     

    I think you are looking for this one

     

    I used your dataset above

    NSW Tender Strategy Termination 1 Completed
    NSW Tender Strategy Issue termination letter to Force Fire 2 Completed
    NSW Tender Strategy Asset List finalisation 3 Completed
    NSW Tender Strategy SME Scope Presentation 4 Completed
    NSW Tender Strategy List of supplier 5 Completed
    NSW Tender Strategy Requirement gathering from State Ops & State Leads 6 Completed
    NSW Tender Strategy Approval 7 Completed
    NSW Transition Comms to the suppliers for the tender outcome 15  
    NSW Transition Contract signing 16  
    NSW Transition Commencing Transition 17  
    QLD Tender Strategy Asset List finalisation 1 Completed
    QLD Tender Strategy SME Scope Presentation 2 Completed
    QLD Tender Strategy List of supplier 3 Completed
    QLD Tender Strategy Requirement gathering from State Ops & State Leads 4 Completed
    QLD Tender Strategy Approval 5 Completed
    QLD Transition Comms to the suppliers for the tender outcome 13  
    QLD Transition Contract signing 14  
    QLD Transition Commencing Transition 15  

     

     

    Solution = var mintask= CALCULATE(min('Table'[Task]),ALLEXCEPT('Table','Table'[State]),'Table'[Status]<>"Completed")


                 return
                        if(mintask=min('Table'[Task]) ,1,0)
     
     

     

     
    Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
    My YT Channel Dancing With Data !! Connect on Linkedin !!Power BI for Tableau Users 
     
     

     

6 Replies

  • WillAlexander's avatar
    WillAlexander
    Frequent Visitor

    Thank you for the tip but it looks like both function return the same values.

    I'm still looking to find out how I can show the next uncompleted task.

    • ribisht17's avatar
      ribisht17
      Super User

      Hi WillAlexander 

       

       

      I think you are looking for this one

       

      I used your dataset above

      NSW Tender Strategy Termination 1 Completed
      NSW Tender Strategy Issue termination letter to Force Fire 2 Completed
      NSW Tender Strategy Asset List finalisation 3 Completed
      NSW Tender Strategy SME Scope Presentation 4 Completed
      NSW Tender Strategy List of supplier 5 Completed
      NSW Tender Strategy Requirement gathering from State Ops & State Leads 6 Completed
      NSW Tender Strategy Approval 7 Completed
      NSW Transition Comms to the suppliers for the tender outcome 15  
      NSW Transition Contract signing 16  
      NSW Transition Commencing Transition 17  
      QLD Tender Strategy Asset List finalisation 1 Completed
      QLD Tender Strategy SME Scope Presentation 2 Completed
      QLD Tender Strategy List of supplier 3 Completed
      QLD Tender Strategy Requirement gathering from State Ops & State Leads 4 Completed
      QLD Tender Strategy Approval 5 Completed
      QLD Transition Comms to the suppliers for the tender outcome 13  
      QLD Transition Contract signing 14  
      QLD Transition Commencing Transition 15  

       

       

      Solution = var mintask= CALCULATE(min('Table'[Task]),ALLEXCEPT('Table','Table'[State]),'Table'[Status]<>"Completed")


                   return
                          if(mintask=min('Table'[Task]) ,1,0)
       
       

       

       
      Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
      My YT Channel Dancing With Data !! Connect on Linkedin !!Power BI for Tableau Users