Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Subtracting one column of a matrix from another and display result


I have a matrix with two date columns and need to display the difference between the two. So the result would look like:



So I start by creating two measures: 


And then created 


I'm not able to add this as a column to the existing matrix, so I've tried things like creating second matrix or table and hiding the row and column names so it looks like one visual 


But no matter what type of visual or how I arrange variables, I can't get the visual to generate.


Any suggestions?








Super User
Super User


I think the issue is here:

delete the quotations ( " " ) keep only the number


View solution in original post

Community Support
Community Support

Hi, @bematth ;

Is your problem solved?  If so, kindly mark the proper reply as a solution to close the case. 

If not,

You could change it to:

Difference = [nf2020] - [nf2021]

Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-yalanwu-msft 

this issue has been solved already. Thank you

Super User
Super User


I think the issue is here:

delete the quotations ( " " ) keep only the number



The above reply ☝️

Aha! That did it!

I swear, 9/10 my error is usally the result of something like that!

Thank you!

Super User
Super User

Hi @bematth 
Difference = [nf2020] - [nf2021]

It is also worth mentioning that it is a good practice to have a date table filtering your fact table.

I get the same results when using Difference = [nf2020] - [nf2021].


Based on the data source, I'm not sure a date table would be a possibility. 


Usually you can create a date table locally and connect it to your fact table. However, what do you mean by same result? You receive an error? What does the error say? Are you sure nf2020 and nf2021 are measure?

I get the same "Cannot display visual... comparison operators do not support comparing values of type integer with vlalues of type text..." error.

nf2020 and nf2021 are measures with the data type being whole number, as is nfdiff.  (And using VALUE didn't work the first time)






Would you please return the two measure alone without the difference and share the results.

As in just pull them into the visual instead? I get the same error:




Please see my last reply with the proposed solution. 

I thought I just did? I posted a screen shot as well. 

Hi @bematth !


I believe the problem resides in your year column.

You try to filter a text value "2020" with a numeric column.

Either change the type of year column to text.

Or change your filter to 2020 instead of  "2020".


Could you try it out and let us know if it worked?


Hope it helped!


Kind regards,


Helpful resources

Vote for T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors