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
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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.