Forum Discussion

Amitkr174's avatar
Amitkr174
Helper III
4 years ago
Solved

Eliminate Records DAX

Hi, I need your help in DAX. I have a scenarion that a Budget has many Milestones with different status. I need to eliminate those budgets all together where the Milestone status is cancelled.    ...
  • Amitkr174's avatar
    4 years ago

    smpa01  Desired output would be that this record (Budget id) will not appear in the report.

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Amitkr174 ,

    I created a sample pbix file(see attachment), please check whether that is what you want.

    1. Create a measure as below to judge whether the current budget include cancelled status

    Flag = 
    VAR _selbuget =
        SELECTEDVALUE ( 'Table'[Budget ID] )
    VAR _tab =
        CALCULATETABLE (
            VALUES ( 'Table'[Budget ID] ),
            FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Milestone Status] = "Canceled" )
        )
    RETURN
        IF ( _selbuget IN _tab, 0, 1 )

    2. Create a visual and apply a visual-level filter with condition (Flag is 1)

    If the above one can't help you get the expected result, please provide more sample data with Text format and your expected result with calculation logic and special examples. Thank you.

    Best Regards