Forum Discussion

megjarvis's avatar
megjarvis
Regular Visitor
3 years ago
Solved

Dynamically select two columns in a table and filter to only show rows where the values differ

(Edited to provide images and link to mock data) I'm tracking the monthly status (pending / in progress / complete) 57 different projects, and the tracking is expected to continue for 2+ years: ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi megjarvis ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) We can create measures.

    First_month = var _min_date = MIN('Table'[Date])
    var _max_date = MAX('Table'[Date])
    var _min_status =MAXX( FILTER( 'Table' , 'Table'[Date]=_min_date) , [Status])
    var _max_status = MAXX( FILTER( 'Table' , 'Table'[Date]=_max_date) , [Status])
    return
    IF(_min_status <> _max_status , _min_status ,BLANK())
    
    Sencod_month = var _min_date = MIN('Table'[Date])
    var _max_date = MAX('Table'[Date])
    var _min_status =MAXX( FILTER( 'Table' , 'Table'[Date]=_min_date) , [Status])
    var _max_status = MAXX( FILTER( 'Table' , 'Table'[Date]=_max_date) , [Status])
    return
    IF(_min_status <> _max_status , _max_status ,BLANK())
     
    Change = var _cur_first = [First_month]
    var _cur_second = [Sencod_month]
    return
    SWITCH(TRUE(),[First_month]="Pending"&&[Sencod_month]="In Progress","Started" ,
    [First_month]="Pending"&&[Sencod_month]="Complete","Started & Finished" ,
    [First_month]="In Progress"&&[Sencod_month]="Complete","Finished" 
    )

    (2) Then the result is as follows.

    Best Regards,

    Neeko Tang

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