The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I wanted to substract CRE-DET exactly 8000-6000 but getting very strange wrong answers.
Here I am using formula
Solved! Go to Solution.
Hi @Analitika
You need to calculate CRE and DET separately. Add more conditions to the filter code of the calculation. Here I add DTE = 0 when calcualte CRE and add CRE = 0 when calcualte DET.
Substract =
VAR _CRE =
CALCULATE (
SUM ( x[CRE] ),
FILTER (
ALL ( x ),
x[ID] = MAX ( x[ID] )
&& x[OBJ_ID] = MAX ( x[OBJ_ID] )
&& x[DET] = 0
)
)
VAR _DET =
CALCULATE (
SUM ( x[DET] ),
FILTER (
ALL ( x ),
x[ID] = MAX ( x[ID] )
&& x[OBJ_ID] = MAX ( x[OBJ_ID] )
&& x[CRE] = 0
)
)
RETURN
_CRE - _DET
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Analitika
You need to calculate CRE and DET separately. Add more conditions to the filter code of the calculation. Here I add DTE = 0 when calcualte CRE and add CRE = 0 when calcualte DET.
Substract =
VAR _CRE =
CALCULATE (
SUM ( x[CRE] ),
FILTER (
ALL ( x ),
x[ID] = MAX ( x[ID] )
&& x[OBJ_ID] = MAX ( x[OBJ_ID] )
&& x[DET] = 0
)
)
VAR _DET =
CALCULATE (
SUM ( x[DET] ),
FILTER (
ALL ( x ),
x[ID] = MAX ( x[ID] )
&& x[OBJ_ID] = MAX ( x[OBJ_ID] )
&& x[CRE] = 0
)
)
RETURN
_CRE - _DET
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
65 | |
60 | |
55 | |
54 | |
32 |
User | Count |
---|---|
180 | |
88 | |
70 | |
46 | |
45 |