Forum Discussion

Locco's avatar
Locco
Helper III
4 years ago
Solved

Material schedule adherence

Hi all,   I have a table with production data which includes production date, quantity, production machine, and part produced. I have another, master table, which shows each production machine and ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Locco ,

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

    Measure = 
    VAR _selmpart =
        SELECTEDVALUE ( 'Master'[Part] )
    VAR _tabm =
        CALCULATETABLE (
            VALUES ( 'Master'[Production Machine] ),
            FILTER ( 'Master', 'Master'[Part] = _selmpart )
        )
    VAR _tabp =
        CALCULATETABLE (
            VALUES ( 'Production'[Production Machine] ),
            FILTER ( 'Production', 'Production'[Part] = _selmpart )
        )
    RETURN  
        IF (
            ISEMPTY ( _tabp ),
            BLANK (),
            IF ( COUNTROWS( EXCEPT ( _tabm, _tabp ) )>0 , "deviation", "same" )
        )

    Best Regards