Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Table Visualization doesn't work when Measure is added

I'm creating a visual that shows the Operator Name, his/her Operator Code, and the associated amount of scrap ($) associated with their work.  I can get the Operator Name and Operator Code to match up, but when I add the measure, the measure shows the Total value all the way down.  I recognize this as a relationship problem, but I have the Operator Code in both of the tables from which I'm pulling the data so I figured that would solve the relationship problem. The only other thing I can think of is that the measure somehow is messing up the relationship.

 

ProdData 

Item_NoOperatorVerticalTopBottomModelVertical Min LengthVertical Max LengthF/B Min LengthF/B Max LengthT/B Min LengthT/B Max LengthVertical IT/OTTop IT/OTBottom IT/OTComplete I-beam CountIncomplete I-beam Count
1Op-1199.998299.997960.0011HP500199.99200.0299.99100.0759.99860.003ITITIT10
21Op-1200.014399.987959.9993HP500199.99200.0299.99100.0759.99860.003ITOTIT01
22Op-1200.0034100.004660.0027HP500199.99200.0299.99100.0759.99860.003ITITIT10
23Op-1200.0161100.003459.9988HP500199.99200.0299.99100.0759.99860.003ITITIT10
24Op-1199.984599.993759.9988HP500199.99200.0299.99100.0759.99860.003OTITIT0

1

 

 

Part Costs

ModelVertical CostTop CostBottom CostI-Beam Cost
HP500 $              4.95 $     2.87 $             6.01

 $          13.83

 

Operators

Operator CodeOperator NameModel
Op-1AndersonHP500
Op-2BettsHP500
Op-3CarhartHP500
Op-4DennisonHP500
Op-5EversHP500
Op-6FranksHP500
Op-7GuilfoyleHP500
Op-8HarrisHP500
Op-9IngallsHP500
Op-10JanisonHP500
Op-11KeltyHP500
Op-12LassiterHP500
Op-13MichaelsHP500
Op-14NorrisHP500
Op-15OatesHP500
Op-16PaytonHP500
Op-17QuincyHP500
Op-18RawlingsHP500
Op-19StevensHP500
Op-20ThomasHP500

 

Measure

I-Beam Scrap Cost =
SUMX (
    VALUES ( ProdData[Model] ),
    VAR OperatorIncompleteCount =
        CALCULATE (
            SUM ( 'ProdData'[Incomplete I-beam Count] ),
            'ProdData'[Incomplete I-beam Count] = 1,
            'ProdData'[Model] = EARLIER ( ProdData[Model] )
        )
    RETURN
        OperatorIncompleteCount
            * SUMX (
                RELATEDTABLE('Part Costs'),
                'Part Costs'[I-Beam Cost]
            )
)
 

 

1 Reply