Forum Discussion
Gabriele_hbto
Helper II
2 years agoDirect query BAD performance, what to do to try to optimize?
Hey guys, can anyone please give me some tips on how to improve performance on my model? I have a simple star schema. The fact table has only 40k rows. I'm required to use DirectQuery. I embed t...
Gabriele_hbto
Helper II
2 years agoOk I'm going to add indexes on Levels.
Those are the measures:
Value = SUM( 'masterdata RiclassificationValuesForReports'[MonthValue] ) + SUM('masterdata RiclassificationValuesForReports'[AdjustmentValue])
Value YTD =SUM('masterdata RiclassificationValuesForReports'[Value])
Compared Value (matrix) =
VAR __SelectedComparedValue = SELECTEDVALUE('Selection Compared Value'[Selection Code])
RETURN
if(ISBLANK('dim Reclassifications'[Reclassification Hierachy Selected Level]), blank(),IF( HASONEVALUE('Selection Compared Value'[Selection Code]),
SWITCH(
__SelectedComparedValue,
"PY", [Value PY],
"BDG", [Budget]
),
[Value PY]
))
%Δ Value-Compared Value (matrix) =
VAR __Delta = DIVIDE( [Δ Value-Compared Value (matrix)], [Compared Value (matrix)] )
RETURN
if(ISBLANK('dim Reclassifications'[Reclassification Hierachy Selected Level]), blank(),
IF(
SELECTEDVALUE('dim Reclassifications'[Level2Code]) = "E.B", - __Delta,
__Delta))
lbendlin
Super User
2 years agothis one
Compared Value (matrix) =
VAR __SelectedComparedValue =
SELECTEDVALUE ( 'Selection Compared Value'[Selection Code] )
RETURN
IF (
ISBLANK ( 'dim Reclassifications'[Reclassification Hierachy Selected Level] ),
BLANK (),
IF (
HASONEVALUE ( 'Selection Compared Value'[Selection Code] ),
SWITCH ( __SelectedComparedValue, "PY", [Value PY], "BDG", [Budget] ),
[Value PY]
)
)
can probably use some refactoring. You can check its query plan in DAXStudio.