Forum Discussion

Kerk's avatar
Kerk
Frequent Visitor
4 years ago

Difference between two matrix columns

Hello everyone,

 

I am working with athletes times and in the "CRs" tab of the attached pbix. I am comparing an athlete's time against record times (effectively in my data set, record times have been created as if they were an "athlete's" time). So in reality my matrix is comparing the times between two "Athletes". 

As you will see in the first Matrix I have created a conditional formating, to color in Green the fastest time (The slowest was supposed to be colored red, but it doesn't. I haven't figured out why it doesn't yet posted here ).

However, I also want to add a column that will provide the time difference [Record time] - [Athlete's time] to show how far away is the athlete from the record.  I would like though to always substract the athlete's time from the record, in this example: [CWSC 9yo all time RC-Girls] - [MEO O]

 

As discussed record times are represented as times of an Athlete, however these "Athletes" are flaged as "Dummy"

e.g. [CWSC 9yo all time RC-Girls] has a flag DummySwimmer = True

So the calculation has to be: ["DummySwimmer's" time] - [Real swimmer's time]

 

I tried to resolve this following feedback from Ashish_Mathur  provided here:

https://community.powerbi.com/t5/Desktop/Dynamic-calculation-for-difference-between-two-non-date-mat... 

I have twicked this to my schenario creating the Measure: "Difference2", however I need help implementing the logic  [Record time] - [Athlete's time] and not MAX(Value) - Min(Value) as it currently stands.

 

 

I would be greatful if you could help me resolve this

Kerk

 

pbix: https://www.dropbox.com/s/z5xhmh7fh9blwbo/SWM_TestDB_3.pbix?dl=0 

 

3 Replies

  • aj1973's avatar
    aj1973
    Community Champion

    Hi Kerk 

    Adding MinMax to your Matrix shows only the number 1 = Green into your Conditional color column

    Number 2 is not there that's why you don't see red color.

  • v-zhangti's avatar
    v-zhangti
    Community Support

    Hi, Kerk 

     

    Please indicate which data of Difference in this screenshot is wrong?

     

    Best Regards

    • Kerk's avatar
      Kerk
      Frequent Visitor

      Hi v-zhangti ,

       

      I would like to always compute the difference [CWSC 9yo all time RC-Girls] - [MEO O] with this specific order, for every row. So the below marked in red values should have a negative sign.

       

       

      Many thanks