This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi dear, I have the following measure that currently works well however being part of a multilevel report when deploying a category that can contain up to 800 items the calculation becomes slow and consequently the matrix display my question is how can I improve that measure so that it calculates only on the current level that I am selecting (displaying) in the matrix.
Volume3:=SWITCH(TRUE(), HASONEVALUE(Sales[Item]),[Volume2], HASONEVALUE(Division[DivShort]),(DIVIDE(Sales[Qtty Current],Sales[Qtty Last],0)-1)*Sales[MXP-USD Last], HASONEVALUE(Customer[SECTOR]),(DIVIDE(Sales[Qtty Current],Sales[Qtty Last],0)-1)*Sales[MXP-USD Last], HASONEVALUE(Customer[Holding]),(DIVIDE(Sales[Qtty Current],Sales[Qtty Last],0)-1)*Sales[MXP-USD Last], HASONEVALUE(Vendor[Name]),(DIVIDE(Sales[Qtty Current],Sales[Qtty Last],0)-1)*Sales[MXP-USD Last], HASONEVALUE(Sales[CURR]),SUMX(VALUES(Class[Description Class]),Sales[ZVolume2]), BLANK() )
Solved! Go to Solution.
Hi @Anonymous
I would suggest you could create several measures to achieve that.For example:
Measure1=(DIVIDE(Sales[Qtty Current],Sales[Qtty Last],0)-1)*Sales[MXP-USD Last]
Measure2=SUMX(VALUES(Class[Description Class]),Sales[ZVolume2])
Volume3 :=
SWITCH (
TRUE (),
HASONEVALUE ( Sales[Item] ), [Volume2],
HASONEVALUE ( Division[DivShort] ), [Measure1],
HASONEVALUE ( Customer[SECTOR] ), [Measure1],
HASONEVALUE ( Customer[Holding] ), [Measure1],
HASONEVALUE ( Vendor[Name] ), [Measure1],
HASONEVALUE ( Sales[CURR] ), [ Measure2],
BLANK ()
)
Or
Volume3 :=
IF (
HASONEVALUE ( Sales[Item] ),
[Volume2],
IF (
HASONEVALUE ( Division[DivShort] ) || HASONEVALUE ( Customer[SECTOR] )
|| HASONEVALUE ( Customer[Holding] )
|| HASONEVALUE ( Vendor[Name] ),
[Measure1],
IF ( HASONEVALUE ( Sales[CURR] ), [ Measure2] )
)
)
Regards,
Hi @Anonymous
I would suggest you could create several measures to achieve that.For example:
Measure1=(DIVIDE(Sales[Qtty Current],Sales[Qtty Last],0)-1)*Sales[MXP-USD Last]
Measure2=SUMX(VALUES(Class[Description Class]),Sales[ZVolume2])
Volume3 :=
SWITCH (
TRUE (),
HASONEVALUE ( Sales[Item] ), [Volume2],
HASONEVALUE ( Division[DivShort] ), [Measure1],
HASONEVALUE ( Customer[SECTOR] ), [Measure1],
HASONEVALUE ( Customer[Holding] ), [Measure1],
HASONEVALUE ( Vendor[Name] ), [Measure1],
HASONEVALUE ( Sales[CURR] ), [ Measure2],
BLANK ()
)
Or
Volume3 :=
IF (
HASONEVALUE ( Sales[Item] ),
[Volume2],
IF (
HASONEVALUE ( Division[DivShort] ) || HASONEVALUE ( Customer[SECTOR] )
|| HASONEVALUE ( Customer[Holding] )
|| HASONEVALUE ( Vendor[Name] ),
[Measure1],
IF ( HASONEVALUE ( Sales[CURR] ), [ Measure2] )
)
)
Regards,
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 27 | |
| 25 | |
| 22 | |
| 20 | |
| 14 |
| User | Count |
|---|---|
| 50 | |
| 45 | |
| 20 | |
| 18 | |
| 18 |