Forum Discussion
LoooY
2 years agoRegular Visitor
Calculated Item overriding selected measure calculation
Hi there, I am a bit new to Power BI and ran into a problem. First of all, I have data looks like this Year Month Date CentreCode Item Actual Budget 2024 Jan 1...
- 2 years ago
Thank you. I solved the problem.
First of all, I created a sperate measure like XU suggested~And then, I modified my calculated item formula
Anonymous
2 years agoNot applicable
Hi LoooY
Please try this:
I create a new measure which can get right outcome:
Measure =
VAR _currentMonth = SELECTEDVALUE(Data[Month])
RETURN
IF(
SELECTEDVALUE(Data[Item]) = "Net Profit",
SUMX(
FILTER(
'Data',
'Data'[Item] = "Net Profit"
),
'Data'[Actual]
) / SUMX(
FILTER(
ALLSELECTED('Data'),
'Data'[Month] = _currentMonth && 'Data'[Item] = "Revenue"
),
'Data'[Actual]
) - SUMX(
FILTER(
'Data',
'Data'[Item] = "Net Profit"
),
'Data'[Budget]
) / SUMX(
FILTER(
ALLSELECTED('Data'),
'Data'[Month] = _currentMonth && 'Data'[Item] = "Revenue"
),
'Data'[Budget]
)
)
Then change the Variance:
Variance =
IF (
SELECTEDVALUE ( Data[Item] ) <> "Cost",
[Total Actual] - [Total Budget],
ABS ( [Total Actual] - [Total Budget] )
)
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
LoooY
2 years agoRegular Visitor
Thank you Xu
I have a calculated item for net profit % which is
Net Profit % = Calculate ( SELECTEDMEASURE(), Data’[Item] in {“Net Profit”} ) / Calculate ( SELECTEDMEASURE(), Data’[Item] in {“Revenue”} )
Is there any way we can start from here? As I want to display net profit % for Actual and Budget as well.