Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
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:
Thank you
Solved! Go to Solution.
Hi @Anonymous ,
Modify your measure as below:
Hi @Anonymous ,
Try :
if(isblank([Plan]);0;CALCULATE([Actual] - [Plan]))
@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:
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
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
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
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 37 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 69 | |
| 67 | |
| 32 | |
| 27 | |
| 26 |