Forum Discussion
Material schedule adherence
- Anonymous4 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
Locco , New column Production table
if([Production Machine] = maxx(filter(Master , Master[Part] =Production[Part] ), Master[Product Machine]), true(), false())
- Locco4 years ago
Helper III
Thanks amitchandak , that does work but I ran into another problem.
The master table has a few parts which build on 2 different machines. For these, even though it ran on one of the two correct machines, it is displaying false instead of true.
Is there a modification to allow it to give a correct result with this in mind?
- Anonymous4 years agoNot applicable
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
- Locco4 years ago
Helper III
Thanks Anonymous , but I was unable to get the measure to work correctly.
I created a visual table with the production machines in a column and the parts in a column. I have about 30 rows, when I add the measure as a new column the results filter down to only 1 row. This is also the only machine/part combination which is unique, meaning only 1 part is built on that machine. For the other machines which build multiple parts, they were removed or on another table they have a blank, only the 1 part is showing "same."
Also, in the screenshot you provided the measure is returning an incorrect value. "Part B" should say "same," and not "deviation."