Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Calculate Difference Between All Matrix Values Listed Against One Field Value For the Given Row

Hello, I've created a Matrix which shows Average Production Qty in the "Values" section of the Matrix along with Week Start Number for the "Columns" section followed by Plant Name, Production Line...
  • v-eachen-msft's avatar
    6 years ago

    Hi Anonymous ,

     

    You could create a measure to set color in the conditional formatting( you could change color with color codes like "#FF00FF" ).

    Measure =
    IF (
        SELECTEDVALUE ( 'Table'[Target] ) > SELECTEDVALUE ( 'Table'[Value] ),
        "red",
        "green"
    )

    You could add this measure here.

    Here is the result.

     

  • Anonymous's avatar
    Anonymous
    6 years ago

    This is the other DAX solution used to calculate the differences to drive the conditional formatting...

     

    Summary Differences = CALCULATE('HANA Production Fact'[Avg Prod Qty Per Total Shifts by Week]-MINX('Excel Production Throughput Baselines Targets','Excel Production Throughput Baselines Targets'[Avg. Target]),FILTER('HANA Production Fact',RELATED('Excel Production Throughput Baselines Targets'[Plant Number and Production Line])='HANA Production Fact'[Plant Number and Production Line]))
     
    There's only one [Avg. Target] value to be returned so either the MINX() or MAXX() functions can be used here.