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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sraj
Responsive Resident
Responsive Resident

Difference between values in two tables

Hi,

I am using this measure to find the variance between two values in different table.

Diff = Sum(2022_comparison[owner]) - sum(2021_comparison[owner])

 

The measure is working fine as needed, but I wanted to see if it's possible to not show the difference if both the values dont exist.  Here you can see no values for Owner 2022 in 5/25 to 5/31, but the diff still shows -94093, -94054, -93996 and so.  That's what I dont want to be shown on here.  

 

sraj_0-1653418520225.png

 

Can someone please advise?  Thank you!

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@sraj , Try a measure like

 

Diff =
Var _1 = Sum(2022_comparison[owner])
var _2 = sum(2021_comparison[owner])
return
if( not(isblank(_1)) && not(isblank(_2)) , _1-_2 , blank())

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@sraj , Try a measure like

 

Diff =
Var _1 = Sum(2022_comparison[owner])
var _2 = sum(2021_comparison[owner])
return
if( not(isblank(_1)) && not(isblank(_2)) , _1-_2 , blank())

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.