Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Kerk
Frequent Visitor

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

Kerk_0-1654427089527.png

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.

 

Kerk_2-1654429896230.png

 

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 3
v-zhangti
Community Support
Community Support

Hi, @Kerk 

 

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

vzhangti_0-1654667726034.png

 

Best Regards

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.

 

Kerk_0-1654679872120.png

 

Many thanks

 

 

 

aj1973
Community Champion
Community Champion

Hi @Kerk 

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

aj1973_0-1654458647976.png

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

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.