Forum Discussion
need help
- 11 months ago
Hi Bhavyamalik149,
Thank you for the update.We kindly request you to provide sample data that clearly demonstrates your issue in a structured format (not as an image) to help us understand and resolve the matter. Please ensure that the data is relevant, free from any sensitive information, and directly related to the issue. Additionally, please share the expected outcome based on the given example.
Thank you.
Anonymous , Try using
-- RTY = EXP(SUMX(VALUES([Workstation]), [Calc3]))
-- [Calc3] = IF([calcCDWON_rwrk] < [calcCDWON], LOG(1 - DIVIDE([calcCDWON_rwrk], [calcCDWON])), -1)
RTY :=
VAR Workstations = VALUES(Fact[Workstation])
VAR Calc3Table =
ADDCOLUMNS(
Workstations,
"calcCDWON", CALCULATE(
DISTINCTCOUNT(Fact[WipOrderNo]),
Fact[OperationStatus] = 5,
Fact[ReasonCode] = BLANK(),
Fact[ReasonCodeGroup] = BLANK()
),
"calcCDWON_rwrk", CALCULATE(
DISTINCTCOUNT(Fact[WipOrderNo]),
Fact[OperationStatus] = 5,
Fact[IsReworkFlag] = 1,
Fact[ReasonCode] = BLANK()
)
)
VAR Calc3 =
ADDCOLUMNS(
Calc3Table,
"Calc3Value",
IF(
[calcCDWON_rwrk] < [calcCDWON],
LOG(1 - DIVIDE([calcCDWON_rwrk], [calcCDWON])),
-1
)
)
VAR SumCalc3 = SUMX(Calc3, [Calc3Value])
RETURN
IF(MINX(Calc3, [Calc3Value]) = -1, 0, EXP(SumCalc3))
And
-- FPY Global Average = AVERAGEX(VALUES([Workstation]), 1 - DIVIDE([calcCDWON_rwrk_global], [calcCDWON_global]))
FPY_Global_Avg :=
VAR Workstations = VALUES(Fact[Workstation])
RETURN
AVERAGEX(
Workstations,
VAR calcCDWON_global = CALCULATE(
DISTINCTCOUNT(Fact[WipOrderNo]),
Fact[ReasonCode] = BLANK(),
Fact[ReasonCodeGroup] = BLANK()
)
VAR calcCDWON_rwrk_global = CALCULATE(
DISTINCTCOUNT(Fact[WipOrderNo]),
Fact[IsReworkFlag] = 1
)
RETURN
1 - DIVIDE(calcCDWON_rwrk_global, calcCDWON_global)
)
Thanks Bhanu for being helpful but it did not get the desired result, infact it was too far fetched than it was expected.