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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Matrix: Variance blank fields

Hi Everyone,

I created the below matrix but I need help to create an optimal variance between Plan and Actual. 

Right now I made the following DAX formula to measure Var:

Var = IF([Actual] = BLANK();BLANK();CALCULATE([Actual] - [Plan]))

This formula works fine but I want the yellow fields to be 0 instead of BLANK. 17-July and after needs to be blank as illustrated 🙂

 

seryil_0-1594984207857.png

Thank you

 

1 ACCEPTED SOLUTION

Hi  @Anonymous ,

 

Modify your measure as below:

If(MAX[date]>=TODAY(),BLANK(),if(isblank([Plan]);0;CALCULATE([Actual] - [Plan])))
 
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

View solution in original post

6 REPLIES 6
v-kelly-msft
Community Support
Community Support

Hi @Anonymous ,

 

Try :

if(isblank([Plan]);0;CALCULATE([Actual] - [Plan]))

 

Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Anonymous
Not applicable

@v-kelly-msft @mahoneypat @amitchandak  Thank you reply. I don't want zeros after today. So 21 July and after should be blank. All of your solutions include zeros after today 🙂

Hi  @Anonymous ,

 

Modify your measure as below:

If(MAX[date]>=TODAY(),BLANK(),if(isblank([Plan]);0;CALCULATE([Actual] - [Plan])))
 
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!

Please try this instead.

 

NewMeasure =
VAR thisdate =
    MIN ( 'Date'[Date] )
VAR maxfactdate =
    CALCULATE ( MAX ( Fact[Date] ), ALL ( Fact ) )

RETURN
    IF (
        thisdate <= maxfactdate ,
        [Actual] - [Plan] + 0,
        [Actual] - [Plan]
    )

 

If that doesn't work, please return just the thisdate and maxfactdate variables in the return to see where the logic is breaking down for troubleshooting.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


mahoneypat
Microsoft Employee
Microsoft Employee

Assuming your matrix is using columns from your Date/Calendar table, you might approach it like this:

 

NewMeasure =
VAR thisdate =
    MIN ( 'Date'[Date] )
VAR maxfactdate =
    CALCULATE ( MAX ( Fact[Date] ), ALL ( Fact ) )
VAR thisactual = [Actual]
RETURN
    IF (
        AND ( ISBLANK ( thisactual ), thisdate <= maxfactdate ),
        0,
        thisactual - [Plan]
    )

 

It finds the max date for which you have data (maxfactdate) and uses that in the logic.  It also calculates your Actual as a variable, so it is calculated only once for performance reasons.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


amitchandak
Super User
Super User

@Anonymous , You can try.

Var = IF(isblank([Actual]) ;blank();if(isblank([Plan]);0;CALCULATE([Actual] - [Plan])))

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors