Forum Discussion
hayali01
5 years agoRegular Visitor
Filter by Value code in Measure
Hello, I want to select certain cost codes in the cost code column to allow divison by another value. In a very simplified version I want to total the cost of the A codes and divide by the average ar...
CNENFRNL
5 years agoCommunity Champion
Hi, hayali01 , why not make a small transformation to the dataset, which saves a lot of trouble and brings about much clarity in authoring measures.
Avg Cost =
DIVIDE (
CALCULATE (
SUM ( 'Table'[COST] ),
FILTER ( ALL ( 'Table' ), 'Table'[Region] = MAX ( 'Table'[Region] ) )
),
CALCULATE (
AVERAGE ( 'Table'[Area (m2)] ),
FILTER ( ALL ( 'Table' ), 'Table'[Region] = MAX ( 'Table'[Region] ) )
)
)