Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello, i have 2 measures, the second one calls the first one but i need to optimize them since they are taking long time to compute with large data:
Measure 1:
Solved! Go to Solution.
@sarahomar955 , Try using variables
For measure 1
dax
L10 =
VAR Actuals_L10 =
CALCULATE(
SUM('SBI Actuals Agg (x100)'[Actuals]),
FILTER(
ALLEXCEPT(
'SBI Actuals Agg (x100)',
'SBI Actuals Agg (x100)'[pc],
'SBI Actuals Agg (x100)'[Country],
'SBI Actuals Agg (x100)'[ch],
'SBI Actuals Agg (x100)'[mc],
'SBI Actuals Agg (x100)'[brand],
'SBI Actuals Agg (x100)'[ch3]
),
'SBI Actuals Agg (x100)'[Line of Items] = "[L10]"
)
)
VAR Actuals_GES =
CALCULATE(
SUM('SBI Actuals Agg (x100)'[Actuals]),
FILTER(
ALLEXCEPT(
'SBI Actuals Agg (x100)',
'SBI Actuals Agg (x100)'[pc],
'SBI Actuals Agg (x100)'[Country],
'SBI Actuals Agg (x100)'[ch],
'SBI Actuals Agg (x100)'[mc],
'SBI Actuals Agg (x100)'[brand],
'SBI Actuals Agg (x100)'[ch3]
),
'SBI Actuals Agg (x100)'[Line of Items] = "[GES]"
)
)
VAR Actuals_L6a =
CALCULATE(
SUM('SBI Actuals Agg (x100)'[Actuals]),
FILTER(
ALLEXCEPT(
'SBI Actuals Agg (x100)',
'SBI Actuals Agg (x100)'[pc],
'SBI Actuals Agg (x100)'[Country],
'SBI Actuals Agg (x100)'[ch],
'SBI Actuals Agg (x100)'[mc],
'SBI Actuals Agg (x100)'[brand],
'SBI Actuals Agg (x100)'[ch3]
),
'SBI Actuals Agg (x100)'[Line of Items] = "[L6a]"
)
)
RETURN
DIVIDE(Actuals_L10, Actuals_GES - Actuals_L6a, 0)
and for measure 2
Proud to be a Super User! |
|
@sarahomar955 , Try using variables
For measure 1
dax
L10 =
VAR Actuals_L10 =
CALCULATE(
SUM('SBI Actuals Agg (x100)'[Actuals]),
FILTER(
ALLEXCEPT(
'SBI Actuals Agg (x100)',
'SBI Actuals Agg (x100)'[pc],
'SBI Actuals Agg (x100)'[Country],
'SBI Actuals Agg (x100)'[ch],
'SBI Actuals Agg (x100)'[mc],
'SBI Actuals Agg (x100)'[brand],
'SBI Actuals Agg (x100)'[ch3]
),
'SBI Actuals Agg (x100)'[Line of Items] = "[L10]"
)
)
VAR Actuals_GES =
CALCULATE(
SUM('SBI Actuals Agg (x100)'[Actuals]),
FILTER(
ALLEXCEPT(
'SBI Actuals Agg (x100)',
'SBI Actuals Agg (x100)'[pc],
'SBI Actuals Agg (x100)'[Country],
'SBI Actuals Agg (x100)'[ch],
'SBI Actuals Agg (x100)'[mc],
'SBI Actuals Agg (x100)'[brand],
'SBI Actuals Agg (x100)'[ch3]
),
'SBI Actuals Agg (x100)'[Line of Items] = "[GES]"
)
)
VAR Actuals_L6a =
CALCULATE(
SUM('SBI Actuals Agg (x100)'[Actuals]),
FILTER(
ALLEXCEPT(
'SBI Actuals Agg (x100)',
'SBI Actuals Agg (x100)'[pc],
'SBI Actuals Agg (x100)'[Country],
'SBI Actuals Agg (x100)'[ch],
'SBI Actuals Agg (x100)'[mc],
'SBI Actuals Agg (x100)'[brand],
'SBI Actuals Agg (x100)'[ch3]
),
'SBI Actuals Agg (x100)'[Line of Items] = "[L6a]"
)
)
RETURN
DIVIDE(Actuals_L10, Actuals_GES - Actuals_L6a, 0)
and for measure 2
Proud to be a Super User! |
|
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
9 | |
7 | |
6 | |
5 |
User | Count |
---|---|
20 | |
11 | |
10 | |
9 | |
6 |