Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
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 guys!
I am suffering with a performance issue for a measure.
It is derived from several others, so I'll paste all the ones that are calculated for the last one to exist.
All the previous are not affecting the performance when brought in a table (for instance).
Do you have any advices to save processing, maybe using different syntaxes...
This is what I did to calculate the average use for the next 30 days of every item
Then this is what I did to find out the target stock value for each one
I then do a SUMX against the unit values
This is how I calculate what I current have in Stock
And finally this is the Measure that is causing the performance impact, when I have to calculate the Excess Stock existent based on all the previous ones
Solved! Go to Solution.
@Anonymous,
You can use variable to avoid double calculation in your measure:
Excess Stock =
VAR result = [Valid Stock Value] - [TargetStockValue] - [No Future Use]
RETURN
IF ( result < 0, 0, result )
@Anonymous,
Same principle applies. You want to avoid repeating measure because it calculates every time you mention it. Use variable so the result is stored in the memory
Stock OK =
VAR validStock = [Valid Stock Value]
VAR targetStock = [TargetStockValue]
RETURN
SWITCH ( TRUE (); validStock >= targetStock; targetStock; validStock )
@Anonymous,
You can use variable to avoid double calculation in your measure:
Excess Stock =
VAR result = [Valid Stock Value] - [TargetStockValue] - [No Future Use]
RETURN
IF ( result < 0, 0, result )
@Anonymous
This one is still a bit slow, though... any ideas about it?
@Anonymous,
Same principle applies. You want to avoid repeating measure because it calculates every time you mention it. Use variable so the result is stored in the memory
Stock OK =
VAR validStock = [Valid Stock Value]
VAR targetStock = [TargetStockValue]
RETURN
SWITCH ( TRUE (); validStock >= targetStock; targetStock; validStock )
@Anonymous
@Anonymous wrote:@Anonymous,
You can use variable to avoid double calculation in your measure:
Excess Stock = VAR result = [Valid Stock Value] - [TargetStockValue] - [No Future Use] RETURN IF ( result < 0, 0, result )
Awesome! This reduced the calculation time from 4 minutes to 10 secs. Thanks!
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 | |
| 38 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 68 | |
| 65 | |
| 30 | |
| 26 | |
| 25 |