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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Ash1807
New Member

Difference between 2 matrix

I have created 2 matrix from a table which shows stock on hand on a particular date. For date selection i have used 2 date slicers and have applied edit interaction so that 1st slicer is associated with 1st matrix and 2nd is associated with 2nd mateix. I wanna have a 3rd matrix which shows difference in stock between previous 2 matrix. How to do that?

1 ACCEPTED SOLUTION
v-rongtiep-msft
Community Support
Community Support

Hi @Ash1807 ,

Please have a try.

You can create a third matrix that shows the difference in stock between the previous two matrices by using the "New Measure" option. You can create a measure that subtracts the value of the first matrix from the value of the second matrix. You can then add this measure to the third matrix.

Difference =
SUM ( Table[StockOnHand] )
    - CALCULATE ( SUM ( Table[StockOnHand] ), ALLSELECTED () )

This formula calculates the difference between the sum of the "StockOnHand" column for the entire table and the sum of the "StockOnHand" column for the selected dates. You can then add this measure to the third matrix.

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

1 REPLY 1
v-rongtiep-msft
Community Support
Community Support

Hi @Ash1807 ,

Please have a try.

You can create a third matrix that shows the difference in stock between the previous two matrices by using the "New Measure" option. You can create a measure that subtracts the value of the first matrix from the value of the second matrix. You can then add this measure to the third matrix.

Difference =
SUM ( Table[StockOnHand] )
    - CALCULATE ( SUM ( Table[StockOnHand] ), ALLSELECTED () )

This formula calculates the difference between the sum of the "StockOnHand" column for the entire table and the sum of the "StockOnHand" column for the selected dates. You can then add this measure to the third matrix.

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.