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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
BobKoenen
Helper IV
Helper IV

Substract 2 measures when only when one is not blank, else return blank or 0

I have a matrix in which I have 2 measures and now I want to create a 3rd measure which gives me [measure1 - measure 2] only when measure 2 is not blank. If measure 2 is blank then measure 3 should also be blank.

 

Outcome

Department employeeMeasure 1Measure 2Measure 3
ITJohn10  
ITIlse2050-30
FinanceJack241014
FinanceJosie34304
FinanceJebaca65  
HRJay655015
HRJones50  

 

I have tried the measure below but is does not work unfortunatly. 

 

Measure 3 =
VAR BB = [Measure 1]
VAR VC = [measure 2]

RETURN
IF (
NOT ISBLANK ( BB ),
BB - VC,BLANK()
)

 

I hope you can help me

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @BobKoenen 

Measure 3 =
VAR BB = [Measure 1]
VAR VC = [measure 2]

RETURN
IF (
NOT ISBLANK ( VC ),
BB - VC,BLANK()
)

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

View solution in original post

1 REPLY 1
AlB
Community Champion
Community Champion

Hi @BobKoenen 

Measure 3 =
VAR BB = [Measure 1]
VAR VC = [measure 2]

RETURN
IF (
NOT ISBLANK ( VC ),
BB - VC,BLANK()
)

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

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!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

Feb2025 NL Carousel

Fabric Community Update - February 2025

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